Move a site from a server to another without Plesk.

There are many problems in Plesk Backup system and migration system, specially when someone wants to move a site from a server to another. Sites and clients usually cannot be restored, backup files doesn’t appear in the system e.t.c.

So, how can we move a site to another server?

Backup site manually in Plesk.

  • Go to var/www/vhosts/domain/httpdocs
  • Tar all the httpdocs folder but remember to keep the permissions of the folders and files inside the tar.  To do that, you can use the command “tar -cvpzf mydomain.tgz
  • download the tar file to your computer (you can also use wget or ssh to move the tar file from server to server)
  • do the same with folder var/lib/mysql/<nameofthedatabase> (the database of your site).
  • When you download this tar create a client and domain in plesk, in your new server
  • Go to httpdocs folder of the new server
  • extract files in the httpdocs folder using command tar -xvzpf mydomain.tgz /var/www/vhosts/domaininnewserver/httpdocs/ (keep in mind that you have to give to httpdocs folder itself the right permissions. For example if httpdocs has 755 then the tar command cannot make a folder with 777 permissions). 
  • Create a database in the new server with the same name that you had in your old server
  • Go to var/lib/mysql/nameofthedatabase
  • Upload the database tar file
  • Extract files with the same command (tar -xvzpf databasefile.tgz  /var/lib/psa/nameofthedatabase/)
  • restart your server
  • Everything should work now

No comments:

Post a Comment