Restoring wordpress website database problem

Hi 1hackers
I have problem with restoring my wordpress website :pensive:

The story begin when a hostinger (hosting service) canceled my plan for copyrights content🥵.
I asked the costumers for a backup they given me two links one for files and the other for sql database :smirk:

For information i was have 2 websites on the old host service i dont know if the sql file contain the both data or only one website

I have upload downloaded files on my new hosting via file manager but when i upload database on myphpadmin the site didn’t load🤦.

I tried with old file database (has more than year) the website was loaded perfectely but with no recents topics :triumph:

Please any solution for resolving this problem or any method to get my database i have wordpress app on my mobile with recent topics but cant update those topics

Hi,

If there is only 1 sql file so its going to be for one website database only.

As you said you have uploaded the database to new server, and website didnt work, you can try making a new database and new database user and giving all privelages to the user and then import sql file in the database and see if it works.

Also could you share what error message did you get when you uploaded the files and database? If everything was setup correctly and only database issue was there then you should get error as “Error establishing a database connection”. if not then there maybe some other issue.

Forgot to mention 2 things

  1. keep a copy of original files which you got from your existing host.
  2. if you make a new database, do not forget to update the wp-config.php
1 Like

I made new database with all user privilege and i imported database on it also updated wp-config file with new database name & user & pass when i load website it shows only white page no error or message

Edit your wpconfig file and set the debug to true youtu.be will see the error message

now the website home page load but but i got 404 error when i click on any post also cant login to wp-admin

  1. The posts give 404 error because permalinks are not set.

  2. wp-admin not opening that means either the wp-admin url is changed to something else or some security plugin installed on the site that is stopping you to login into the wp-admin. Please share the error message when you open wp-admin.

  3. Go to the wp-includes folder and check the version.php file (It shows the wordpress version installed). Now download that version core wordpress from wordpress.org. Remove the core wordpress files and re-upload the core wordpress.

  4. The directory structure might be the issue i.e. the path /home/xxxx/xxxx in the wordpress database and you need to check that in the database entries and change them to new server path. You can see the new server path in cpanel file manager.

  5. Check php version on the new server installed and play by downgrading/upgrading the server’s php version and you will get something out of it.

n°4 how to check the path in database entries?

I had problems in several pages with WordPress and in most it was a plugin problem in others it was the Divi or elementor theme.
What I did was change the directory to the plugins and test with the wordpress startup and administrator.
Also change the directory of the themes that gave me problems and when entering wp-admin delete the theme, download and install an updated version and you’re done.
until they both worked was that I took a backup with AkeebaBackup and debugged on localhost.
well if the database does not work in the hosting it is good to work first with amps or Softaculous in localhost then take a backup and restore in hosting.

it is better to work old databases on localhost because any hosting will cause problems.
I had a lot of problems with this until I worked with Softaculous, I did the deouration and everything went perfect.

after many tries and some search the problem was solved

i contact old host customer for export database from myphpadmin the sql file size was diffirent from the backup sql file given before

after uploading database the home page was loaded perfectely but post not load i got 404 error

this problem caused by .htaccess file (migrate website to new host cause the problem) i re-upload the file from wordpress just typing .htaccess worpress on google then after login on wordpress i confirm the setting of permalinks and the website work fine thanks all

1 Like

Great that your problem got resolved.
From now on, make sure to back up your site.
Use Duplicator Pro or any other plugin that backs up your site to Google Drive, Dropbox etc automatically.

1 Like