Steps to migrate your website from Non-Control Panel Server
You can migrate your website via SSH/FTP.
The details are mentioned below:
Step 1: Back Up Your Website Files
Step 2: Backup your Databases
Step 3: Software Installation
Step 4: Transfer your Website Files and Database Backups
Step 5: Database Restoration
Step 6: Update Database Connection Strings
Step 7: Preview and Test website on the new hosting server
Step 8: Change the DNS
Step 1: Back Up Your Website Files
1) Directly from server using SSH
The very first step of any project is to back up every aspect of your site. You need to connect to the server with the server’s IP address, username, and password. Along with that, you need a command line client like Terminal for Mac and Linux/Putty for Windows.
- Login to your old server using SSH access
Command: ssh username@[server-ip] - Go to the directory where your website is
Command: cd /path/to/your/website/document/root/
If your website resides in “html”, “httpdocs” or “public_html” that’s more than likely the directory you’ll want to be in. - Once you’re in the correct directory (folder), type the following command to compress the contents:
tar -czvf sitename_backup.tar.gz ./
This will create a tar.gz file which will have all contents of that directory (folder).
2) Through FTP
Here, you should connect to your hosting account and download the files locally to your computer. You can use FTP to backup your files. The simple method is using an FTP client such as FileZilla to connect to your FTP server and download your website files.
- Connect to your current hosting account using FTP.
- Locate the directory that contains your Website Files.
- Using your FTP client, download these files to your computer.
Step 2: Backup your Database
Go to the directory where your website is and then use the following command to backup your database.
mysqldump –u mysql_username –p[password] database_name > dump_file.sql
This will dump your database “database_name” to “dump_file.sql” file.
Step 3: Software Installation
a) Check the currently running software on the source server by typing the command: netstat -plnt
Example:
root@server [~]# netstat -plnt
Active Internet connections (only servers)
Proto |
Recv-Q |
Send-Q |
Local Address |
Foreign Address |
State |
PID/Program name |
tcp |
0 |
0 |
0.0.0.0:22 |
0.0.0.0:* |
LISTEN |
1064/sshd |
tcp |
0 |
0 |
127.0.0.1:25 |
0.0.0.0:* |
LISTEN |
1200/master |
tcp |
0 |
0 |
0.0.0.0:443 |
0.0.0.0:* |
LISTEN |
18205/node |
tcp |
0 |
0 |
:::4002 |
:::* |
LISTEN |
18315/node |
tcp |
0 |
0 |
:::9200 |
:::* |
LISTEN |
1103/java |
tcp |
0 |
0 |
:::9300 |
:::* |
LISTEN |
1103/java |
tcp |
0 |
0 |
:::22 |
:::* |
LISTEN |
1064/sshd |
tcp |
0 |
0 |
:::8090 |
:::* |
LISTEN |
18297/node |
b) Check the version of the software and the modules installed on the source server. Refer the application documentation to check the version and module details.
c) Log in to the destination server and install the same software/application version by referring the application documentation.
Step 4: Transfer your Website Files and Database backups
a. Directly from server using RSYNC
- Login to your old server using SSH access ssh username@[old-server-ip]
- Navigate to the folder where the backup is taken Command: cd /path/to/your/website/document/root/
- Now use rsync command on the source server to transfer the contents to the destination server.
Command: rsync -av -P sitename_backup.tar.gz username@[new-server-ip]:/dest-folder/
b. Using FTP
- Connect to your new server account using FTP clients like FileZilla.
- Locate the directory where you have downloaded the website files on your computer
- Using your FTP client, upload the files to the server
Step 5: Database restoration
You can now use the following command in SSH to restore the database on your new server.
- Login to your old server using SSH.
Command: ssh username@[new-server-ip] - Navigate to the folder where the database backup is transferred and restore the database.
Command: mysql database_name < database_backup.sql - Delete the database backup file using the following command.
Command: rm -f database_backup.sql
Step 6: Configure your Application and Database settings
Configure your application and database settings on the software you have installed on the destination server.
Step 7: Preview and test the website on the new hosting server
It’s necessary to test your website before changing the DNS to the new server. You can use the following online tool to check the website on your new server.
- Enter the new server IP Address and the website name on the above website and click on the “GET MY TESTING URL” button.
- You will get a temporary URL. Click on that link to check the website on the new server.
Step 8: Change the DNS
Make the DNS changes at the server and registrar level to start pointing to the new server.