Home / Solutions / Restore Wordpress Website Without Backup
Solutions

Restore Wordpress Website Without Backup

If a WordPress site has no backup, recover it from server files and its database, move hosting and update URLs safely. Read the steps.

Restore WordPress Website Without Backup

The problem

Sometimes a website has no backup. Access can be blocked, or the site can be deleted from the hosting account. If the files and the database are still on the server, you can rebuild the site from them.

Step 1: collect the files and the database

  1. Download all files from the server folder where the domain files are stored (public_html).
  2. Open the wp-config.php file and read the database name, user and password. Check the .htaccess file too.
  3. Open that database in your hosting panel and download it as an SQL file.

Step 2: set up the new hosting

  1. Upload your public_html zip file with FTP to the new domain. Extract it into a new folder inside public_html, then move the files into the main public_html folder.
  2. Create a new database in the hosting panel. Save the database name, user and password.
  3. Put those details into wp-config.php, in the lines shown below.
  4. Import your SQL file into the new database.
define( 'DB_NAME', 'your_database_name' );
define( 'DB_USER', 'your_database_user' );
define( 'DB_PASSWORD', 'your-password-here' );
define( 'DB_HOST', 'localhost' );

Step 3: change the old domain to the new one

  1. Download the Search Replace DB script. Rename its folder to something random, for example srdb-x7k29.
  2. Upload that folder next to wp-config.php, in the WordPress root.
  3. Open it in the browser at yourdomain.com/srdb-x7k29/.
  4. Enter the database details from wp-config.php.
  5. In search for, enter the old domain. In replace with, enter the new domain. Leave all tables selected.
  6. Click dry run first. Check that it finds changes in the posts, postmeta and options tables.
  7. If it looks right, click live run.
  8. If the old URLs came in both http and https forms, run it again for the other form. Run it a third time without the protocol to catch anything left, such as escaped URLs.

Delete the Search Replace DB folder right away. Leaving it online is a security risk, because anyone who finds it could change your database.

Step 4: finish up

  1. Go to Settings, then Permalinks, and click Save.
  2. Go to Elementor, then Tools, and click Regenerate CSS and Data. Use Replace URL there too if you still see old links.
  3. Clear the site cache and the hosting cache.

Mistakes to avoid

  • Skipping the dry run.
  • Leaving the script folder on the server.
  • Forgetting to clear caches, which leaves old links on the page.

Downloads and prompts

Copy the text below, or download the files above.

Instructions: the script and uploading the backup through FTP and the database

1. Start
upload your public_html zip file in the ftp of the new domain and then extract into any folder of the public_html by creating it 
after extraction move all the files into the main public_html file and then you have to go to the database of that domain from hosting and create new database
while creating new database save the name, username, and password of the database
then put those information into the wp-config.php file where it looking like this 
define( 'DB_NAME', 'u123456789_wp123' );
define( 'DB_USER', 'u123456789_wp123' );
define( 'DB_PASSWORD', 'your-password-here' );
define( 'DB_HOST', 'localhost' );
also change the domain name to your new domain on which you upload the zip file 
after that you have to add your sql file into the database when you open database it gives you the option to upload your sql file 
then you have to upload this folder into the public_html and follow next steps
2. Upload by FTP
Unzip the file on your computer. The folder is called Search-Replace-DB-master.
Rename the folder to something random, for example srdb-x7k29.
Upload that folder into the WordPress root, next to wp-config.php. On Hostinger this is domains/YOURDOMAIN.com/public_html.
3. Open it in the browser
Go to https://YOURDOMAIN.com/srdb-x7k29/.
4. Fill in the form
In the database section, enter the name, user, password and host from wp-config.php. (use same information that you add in the wp-config.php)
In search for, enter the old domain, for example https://old-domain.com.
In replace with, enter the new domain, for example https://new-domain.com.
Leave “all tables” selected.
5. Dry run, then the real run
Click dry run and check that it finds changes in the posts, postmeta and options tables.
If it looks right, click live run.
If your old URLs came in both http:// and https:// forms, run it again for the other form. Run it a third time without the protocol (old-domain.com to new-domain.com) to catch anything left, such as JSON-escaped URLs.
6. Delete it right away
Delete the folder from the server by FTP. Leaving it online is a security risk, because anyone who finds it could change your database.
7. Finish up
Go to Settings → Permalinks and click Save.
Go to Elementor → Tools → Regenerate CSS & Data, and use Replace URL there too if you see old links.
Clear all site and hosting cache.

Tools used

FTP client, hosting panel, phpMyAdmin, Search Replace DB script.

Need this done for you? See my technical SEO service.

← All solutions

Keep reading

Related guides

Start typing to see posts you are looking for.