What you need to do to move your site successfully from one hosting account to another
Moving a site from one account to another is a difficult, time-consuming task and there are many problems and issues that could occur. Besides the downtime caused by the move itself, there may be an additional downtime that could be caused by an error or a mistake during the process. We do not recommend moving a production site from one account to another unless really necessary. However if you decide to move your site, please follow the tutorial that we have prepared to make the process as painless as possible and avoid data loss and unnecessary downtime.
To move a site from one web hosting account to another, there are several steps that you need to complete:
– check whether you have enough disk space, domain/subdomain hosting slots, MySQL database slots and email slots in the new account;
– make sure that you are able to edit the name servers of the domain(s) that you will be moving;
– choose the right time – check your statistics to see when you have the last number of visitors and preferably, organize things, so that you complete the transfer within these hours;
– prepare a page that explains to your users that you are moving your site. You should make this page appear during the actual moving.
2) Download files;
3) Download databases;
4) Download mails & save mail settings;
5) Write down all subdomains with the corresponding folders and settings;
6) Remove your domain(s) from the old account and add the domain(s) to the new one. Update the name servers of your domain(s); Re-create subdomains;
7) Recreate FTP accounts and upload files to the new account;
8 ) Re-create databases and import databases to the new account;
9) Re-create emails & mail settings;
10) Change settings (PPA, MySQL connection settings in your scripts, FTP accounts etc.); Restore the original index page.
Before you start moving your site(s) you need to make sure that you are prepared. This is a very important step, so be very thorough while preparing things for the move.
– First thing to do is to make sure that your new account is capable of sustaining your website. The things that you need to check are:
+ disk space – does your new account has enough free disk space (see the Account Usage table)?
+ file quota (check Account Usage table)
+ domain hosting slots – check if you have enough available domain hosting slots for the domain(a) that you are willing to move;
+ subdomain slots – perform the same check described above for subdomains, emails, databases etc.
– Make sure that you are able to edit the name servers of the domain(s) that you are willing to move. You will have to change the name servers to the ones that you see in the Hosted Domains section of your new hosting account, so verify that you have access to edit the name servers of your domain(s);
– Choose the right time – moving your site(s) to your new account will require some time – a few hours, in some cases up to 48 hours. Make sure that you have a few hours to spare, because you will need this time. Interrupting the process before you have moved everything could result in a real mess, so make sure you have the time to complete everything at once, no interruptions. Also consider the load of your site, check your site’s stats to see when your visitors are least active, schedule the move for a time that would cause the least damage (lost visitors, potential customers).
– Prepare a page that informs your visitors that you are moving your site. Make a simple page that explains that you are moving the site, this way your visitors will know what is happening and they will probably return later, so no damage would be caused, no customers lost. From the moment when you start the transfer, you will have to put this page to load instead of your original index page. You can do this with an .htaccess file. This is how you do this:
You create a file called .htaccess (a simple text file, just rename it to .htaccess) and put it in the main folder of your domain, where your index.php/html file is located. Put the following code in the .htaccess file:
In this example moving.html is the page that explains to your visitors that you are moving the site. You can name your page whatever you want, just make sure that the correct name is set in the .htaccess file. Now instead of your web site, your visitors will be seeing the “moving.html” page.
2) Download files. Use FTP to download your files from your current account to your local hard drive. This way you create a backup of your files on your local computer, you will later upload these same files to your new hosting account;
3) Export your database(s). You can backup your database from the phpMyAdmin section of your web hosting control panel. Login to phpMyAdmin. Click on your database (on the left you see the name of the database and all tables under the database, click on the name of your database), then click on “Export” from the top navigation menu. Check the “Save as file” check-box and click on the “Go” button in the bottom right corner. You will later use this backup file to import your database(s) to your new hosting account.
Write down all database names (usernames) and password, you will need them later.
4) Setup a POP3 account in your Outlook (or any other mail client that you use) to download your emails to your local computer. You will not be able to import these to your new hosting account, but you will at least have a copy on your computer. Write down all email accounts and password, you will need them to re-create the email accounts in your new hosting account. Write down all settings – email forwarders, autoresponders etc. Write down the settings in the SPF Protection section, the Anti-Spam Protection section and the Mail Filters section.
5) Go to the Subdomain Manager of your old account and write down all subdomains and the corresponding settings (EPP activated or not, Path – where does the subdomain point to, etc. ). Write down all Password Protected Areas (path, username, password). Write down all FTP accounts with the corresponding paths and passwords.
POINT OF NO RETURN!
From this point on, it is very likely that you will not be able to switch everything back “as it was” to your old account. Be very careful, proceed only if you are 100% sure that you have completed the afore-described steps successfully.
6) Remove the domain(s) that you are going to be moving, from your current account’s Hosted Domains and add them to the Hosted Domains of your new account. It would be best if you want 5-10 minutes after removing the domain(s) from the old account before adding them to the new account.
Once you have added the domain(s), go to the Subdomain Manager of your new account and re-create the subdomains, make sure that each subdomain has the same settings as in the old account (you have written them down in step 5).
Change the name servers of your domain(s) to the ones that you see in the Hosted Domains section of your new web hosting account. The change will need a few hours to take effect. While you are waiting you can use the default FTP account of your new hosting account to connect to FTP and start uploading your files.
7) Connect to your new hosting account via FTP (use the default FTP account with the default subdomain, it is something like username.sc44.info). Upload your files from the backup that you made in step 2, to the corresponding directories.
Recreate your FTP accounts, as they were in your old account (see the notes taken in step 5).
8 ) Go to the Manage SQL Databases section of your new account and re-create your databases with the names and passwords that you have written down in step 3. Note that the names of your new databases will be different because the first part of the name would be the new web hosting account’s username. However keep the same password(s). Once you have re-created the database(s), go to the phpMyAdmin to restore them from the backup that you made in step 3. In the phpMyAdmin there are 5 icons on the left navigation menu, the middle one says SQL, click on it and a new window opens where you see “Import file” in the top navigation links. There you can import the file that you have exported.
9) Re-create emails. Go to the Email Manager of your new hosting account and re-create email accounts using the notes taken in step 4, don’t forget to re-create forwarders and autoresponders.
Re-create the settings in the SPF Protection section, the Anti-Spam Protection section and the Mail Filters section.
Note that the mail server that you have to use for SMTP and POP3/IMAP is now different, you can see what it is, in the Email Manager section.
10) Besides the mail server, there are several other changes, that need your attention:
– MySQL settings are now different.The MySQL database(s) names and usernames are different and the MySQL host is different. You can see the new database names and the new MySQL host name in the Manage SQL Databases section. Update the new settings in all of your scripts that connect to a database.
If at least 6 hours have passed from the moment when you updated the name servers of your domain(s), it is now time to see what the result is. Remove the .htaccess file and the moving.html file from your new account. Open your website. What happens now?
A. You see your website, everything is in order. This means that you have moved your entire site to your new hosting account and nothing went wrong. Although, this is the result that we all hope for, it is very unlikely to be the case. Usually something goes wrong, so…
B. You see the moving.html page instead of your website. What should you do now? Clear your browser’s cache and refresh (press Ctrl + F5). Still the same thing? Not good. Make sure that you have changed the name servers of your domain name(s). Make sure that it has been at least 12 hours since you changed the name servers. If you have changed the name servers of your domain(s) and at least 12 hours have passed and you are still seeing the moving.html page although you have removed it from your new account, please open a ticket.
C. You see a MySQL error. This means that you have either not made the necessary changes to reflect the change of the MySQL name, username and host or you have not imported your database (correctly).
D. You see an Index of/ page and a list of files (or no files at all). This means that you have not uploaded your files or that you have not uploaded all of them or you have uploaded all or part of them to the wrong directory.