What do I need?
- FileZilla : This is a FTP program which can be downloaded for free from https://filezilla-project.org/download.php?type=client. You can use another FTP program if you prefer but the guide below will provide detailed images using FileZilla.
- Maintenance Mode : Your OpenCart website must be in maintenance mode before you start the backups.
- A new hosting account : Our 1 Nut Linux can be purchased from here which will run an OpenCart website quickly and costs £47.40.
- TIP : Contact your registrar and ask them to update your time to live (TTL) to the shortest time possible (e.g. 3 hours).
Step 1a : Backup your old website + database : Automatic wayMany hosting companies have an automatic backup feature (ourselves included) which means you can backup your website and database automatically. If yours has this feature, we suggest using it and skipping to step 2. If yours doesn't have this, don't worry we've listed all the steps below needed to backup your site's files and databases.
Step 1b : Backup your old website + database the old fashioned way!The first thing we need to do is backup your website files. Open up FileZilla (or your favorite FTP program) and enter your current host's FTP Host, username and password into the top boxes then click the Quickconnect button. If you don't know what these settings are then you can usually find them in your control panel with your current hosting company. Failing that, you can contact your host and ask them for these.
Once connected, you will need to navigate to where your OpenCart website is located. This is usually in your public folder called Public_html or Htdocs. If you installed your OpenCart website into a sub folder e.g. yourwebsite.co.uk/shop, then you will need to find your 'shop' folder.
Double click on your public folder to open it.
You should now see your website's files. We need to double check you are in the correct folder for your OpenCart files. Look for the below three files. If you can see these you are in the correct location.
Once you are in the correct location, you will need to select all the files and folders. To do this, left click once on config.php and press the 'CTRL' button and the 'A' key at the same time (command-A on a Mac). This will change all the files to be selected. You can now drag the files into a folder of your choice (left click on one file and drag them over a folder on your computer). We suggest having a folder on your desktop called 'old website' and downloading the files into here.
You will see a lot of connection and download text show in the top bar. Once this has stopped you should have all your OpenCart files downloaded to your computer.
Next, we need to download a copy of your OpenCart database. To do this, we will use phpMyAdmin. You will need to contact your current host and ask them for instructions on how to access phpMyAdmin for your database. Usually this will be under your control panel in a manage MySQL databases section.
Once in phpMyAdmin, click your database from the left hand menu.
You should see a list of tables related to open cart, starting with oc_ e.g. oc_address,oc_affiliate etc.
Next, click the export tab at the top.
Click the custom button then click the 'Select All' link to highlight all of the OpenCart tables.
Finally choose zipped from the 'Compression' drop down, then scroll down and click the 'Go' button.
You will be asked to save this to your computer. Make sure you remember where you save it to as you will need it later.
Step 2 : Upload your OpenCart Files to your new serverNow you have a copy of your website, we need to upload it and restore it on your new hosting/server. If you have purchased hosting with Squirrel Hosting then you can follow this guide exactly. If you're using another company for hosting, you will need to contact them for details on how to connect to your hosting via FTP and how to setup/connect to your database.
Open up FileZilla and connect to your new hosting company. Squirrel Hosting customers check your welcome e-mail for your FTP details. As your domain is still technically loading up your old hosting company at this stage, you will need to use the host's IP address instead of ftp.yourdomain to connect.
Double click on your public folder to open it up (for Squirrel Hosting customers, double click public_html).
Next, we need to upload all the files you downloaded in step 1 (do not upload your MySQL database).
To do this open up the folder where your files are stored and highlight them all, then drag them over onto your public folder.
Step 3 : Create a MySQL DatabaseNow we need to create a new database on your new hosting. This can vary depending on which hosting company you choose to use. For Squirrel Hosting customers, simply follow the below steps. For other hosting companies you will need to contact them and ask how to set up a MySQL Database. You will also need to make a note of the database hostname, username, password and database name then skip to step 4.
For Squirrel Hosting customers only, load up your eXtend control panel (see your welcome e-mail for details on how to do this) and click the MySQL Databases icon.
Next, enter your desired username in the username box and then click the 'Generate Password' button. Finally click Create.
Scroll down to the bottom of the page and under the 'Manage MySQL Databases' section you will see the database you have just created. Make a note of the following;
- Username (including any - )
- Password (hover over to view it)
Step 4 : Upload your OpenCart DatabaseWe now need to load phpMyAdmin on your new hosting to import our OpenCart database. Again if you are with a company other than Squirrel Hosting you will need to contact them for details on how to access your database. For Squirrel Hosting customers, click the 'manage database' button under your 'MySQL databases' button in eXtend.
Once in phpMyAdmin, click your database menu on the left.
Click the 'Choose File' button and select the OpenCart database you made a backup of in step 1. Then scroll down to the bottom and click the 'Go' button.
This may take a few moments to process depending on how big your database is.
Once complete, you should see a message stating "Import has been successfully finished".
You have now restored your database and website files.
Step 6 : Update your config filesIn /config.php and admin/config.php you need to change some variables to make the store re-install work. Open these files in notepad, dreamweaver or your preferred html/code editing application.
If you are uploading the copied site to a Directory you need to specify this in the following files:
After we are done editing the config file we need to right click on config.php and select Set Permissions. We recommend setting the permissions of config.php to 444. This will make the file as read-only.
Next stop, we need to repeat the same procedure with admin/config.php file. We will find the file under admin/config.php. Again we will edit the database settings and change the permissions of the admin/config.php file to 444.