Use restore script to restore website from archive

GD Press Tools Pro includes restore script that can clone/restore full website archive into the new website. Currently, plugin includes a script that  can work with standard WordPress installation (no multisite support yet).

To be sure that website is restored properly, you need to create a full backup on standard (no multisite) WordPress website (database and files), and you need to use GD Press Tools Pro 5.0.5 or newer. Backups made with previous versions of the plugin can’t be restored.

Full Backup Option
Full Backup Option

Once you have the backup file, you need to prepare new location to restore a backup. You can restore the same website on a different server, or you can change website URL, you can change the prefix used for database tables.

Prepare Restore

To restore website to a new location, you need to have restoration server prepared. Here are few pointers to make sure your new website is properly prepared and restore done as is it should.

  1. Destination folder must be empty before you start with the restore. If you have WordPress files in a location where you want to restore website, the restore will replace existing files. This can create problems after restoration is completed, so it is important to start with an empty folder.
  2. Destination folder must be writable. Restore script needs to create folders, unpack the archive, edit some of the files. The folder must be writable by the PHP (same goes for WordPress). This depends on the server and how the PHP is executed. If the folder is writable for FTP access it doesn’t always mean that PHP scripts will have access too. If you are not sure about this, consult your hosting company support or documentation.
  3. Destination folder must be mapped to the domain name (or at least it needs temporary URL that most companies provide until the domain name is set) and must be accessible from the web. When you add a domain to your server through the control panel (cPanel, Plesk or anything else), usually you get the folder where the domain points to. This is the folder you will use for restoring or cloning backup archive.
  4. Database for the restoration or cloning must exist on the mySQL server. Most hosting companies will not allow for any script to be able to create databases, so you must do this before starting the restore. Creating database depends on your hosting company and the server control panel you use (cPanel and Plesk are most common). As with new WordPress installation, you need database server host name, database name, username, and password. This is needed for database restoration step.
Restore Script
Restore Script

Step 1: Get restore script

Once you have the backup file, you need restore script too. To get this script, open Backup plugin panel, and open the second dropdown to get the Restore Script panel. From this panel, you can download ‘gd-restore-backup.php’ file.

This file is located in plugin archive in addons/backup/restore folder if you want to get it from the plugin archive.Step 2:

Step 2: Copy files into restoration location

Now, copy both the restore script and full backup archive into the location where it will be restored. For the purpose of this article, I have prepared demo website that will use restore.dev domain name, and empty folder this domain points to.

Step 3: Run the restore script

If your restore folder is mapped to domain restore.dev, once you copy restore script and backup archive into that folder, you can access restore script by visiting this URL in your browsers:

http://restore.dev/gd-restore-backup.php

This is only an example, URL in your can be different (using HTTPS or with www before domain name).

Once you load the restoration URL, the browser will display the first screen for the restore process. If your database archive is valid, you will get information about that script, if not, you will see an error message.

Step 1
Step 1

If all is OK, and wp-config.php file is present, you can continue to next step, so click Next Step button.

Step 2: Unpacking files

Once you click Next Step on Step 1 screen, the script will start unpacking files. This can take a while, depending on the archive size. Once that is done, you will get next screen.

Step 2
Step 2

Step 3: URL and Database

Most important part of restore process is to set up new URL and the database settings. Once you load the Step 3, you will see this:

Step 3: Old website information
Step 3: Old website information

This is old URL for the website you have in the backup archive and database information from wp-config.php. Now, if you are simply moving the website to a new server, and you want to keep the same URL, you don’t need to change website URL. If you are cloning old site or you are changing URL, you need to enter new full URL (with http or https included). This is URL that you will initially use to access the website, and if you server is set up with domain link, this is the URL you are using to run the restore script.

So, now you need to enter new URL (if it is changed), new database connection settings, and if you want, change the prefix used for WordPress database tables. Once you fill that, make sure you click on the Test Database Settings button. The script will verify connection and prefix, and will display test results.

Step 3: New settings
Step 3: New settings

If you don’t test new settings, or they have failed, continuing with restore will break. So, make sure the data is correct and valid and tested.

Step 4: Finishing Installation

This step will import database data, replace website URL (if you have changed it) and replace old prefix with the new one (if you have changed it). After that, plugin will update wp-config.php and .htaccess files.

Step 4
Step 4

Step 5: Finishing restore

Once all this is done, the last step will clean up the temporary files used for restore and that’s it. You will see new URL to load the newly restored website.

Step 5
Step 5

Troubleshooting

If the script breaks, or you see any errors, make sure you make the note of them and report the errors in the forum. After the backup is completed, test everything: login, admin side, check out error logs.

0
0
451
Rate this article

You are not allowed to rate this post.

Comments

Leave a Reply