KNOWNHOST WIKI

User Tools

Site Tools


pre-sales:manual-migration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pre-sales:manual-migration [2017/02/26 06:36]
mscherf [Manual Migrations] added link
pre-sales:manual-migration [2020/06/16 13:48] (current)
Karson N.
Line 4: Line 4:
  
   * The control panel of the source server and the destination server match((i.e., both servers are cPanel or both servers are DirectAdmin))   * The control panel of the source server and the destination server match((i.e., both servers are cPanel or both servers are DirectAdmin))
-  * We are given the needed level of access in the source server to utilize that panel's standard backup((i.e., in cPanel to [[https://documentation.cpanel.net/display/ALD/Backup+for+cPanel#BackupforcPanel-GenerateaFullBackup|Generate a Full Backup]] or in DirectAdmin to [[https://help.directadmin.com/item.php?id=269|create user backups]]))+  * We are given the needed level of access in the source server to utilize that panel's standard backup((i.e., in cPanel to ((https://documentation.cpanel.net/display/ALD/Backup+for+cPanel#BackupforcPanel-GenerateaFullBackup))[[https://documentation.cpanel.net/display/ALD/Backup+for+cPanel#BackupforcPanel-GenerateaFullBackup|Generate a Full Backup]] or in DirectAdmin to ((https://help.directadmin.com/item.php?id=269))[[https://help.directadmin.com/item.php?id=269|create user backups]]))
  
-If either of these are not possible, the site may need to be migrated manually. We offer this as a paid service for new signups at a discounted rate of $35 per hour. You can read more about this service [[https://www.knownhost.com/migration-assistance.html|here]]. But if you prefer to do it yourself, the process would be approximately as follows.+If either of these are not possible, the site may need to be migrated manually. We offer this as a paid service for new signups at a discounted rate of $35 per hour. You can read more about this service ((https://www.knownhost.com/migration-assistance.html))**[[https://www.knownhost.com/migration-assistance.html|here]]**. But if you prefer to do it yourself, the process would be approximately as follows.
  
 This article will be focusing primarily on the process for a destination server using cPanel/WHM. For DirectAdmin, the process is similar but the needed sections of the panel interface will be found in different locations, as will some of the needed filepaths. This article will be focusing primarily on the process for a destination server using cPanel/WHM. For DirectAdmin, the process is similar but the needed sections of the panel interface will be found in different locations, as will some of the needed filepaths.
  
 +\\
 ===== Creating Accounts in the New Server ===== ===== Creating Accounts in the New Server =====
  
 The first step is to create the account(s) in the new server, so that there is a place to put the data. For cPanel, you can learn more about this [[control-panels:cpanel-whm:getting-started|here]]. The first step is to create the account(s) in the new server, so that there is a place to put the data. For cPanel, you can learn more about this [[control-panels:cpanel-whm:getting-started|here]].
  
 +\\
 ===== Copying the Files ===== ===== Copying the Files =====
  
 Once an account for the site exists in the destination server, you can copy the site files into the new documentroot. The site's Documentroot is the folder in the server that apache will serve files from for a site. In a cPanel server, this is ''%%/home/cpuser/public_html%%''((replacing ''%%cpuser%%'' with the username of the cPanel user)) by default for the main domain of the cPanel account. If you are logging into the server via [[software:how-can-i-configure-win-scp-to-upload-files-via-ftp|ftp]] or [[software:how-can-i-configure-filezilla-to-upload-files-via-sftp|sftp]] as the cPanel user, then you will start out in ''%%/home/cpuser%%'' so you would be looking for folder ''%%public_html%%'' there. How to fetch the files from the source server may vary based on what if any panel is installed in the source server and how it is configured, but once you have downloaded them, you can upload them to the site's new documentroot in the destination server using ftp.((or sftp or webdav or scp or rsync, if preferred)) Once an account for the site exists in the destination server, you can copy the site files into the new documentroot. The site's Documentroot is the folder in the server that apache will serve files from for a site. In a cPanel server, this is ''%%/home/cpuser/public_html%%''((replacing ''%%cpuser%%'' with the username of the cPanel user)) by default for the main domain of the cPanel account. If you are logging into the server via [[software:how-can-i-configure-win-scp-to-upload-files-via-ftp|ftp]] or [[software:how-can-i-configure-filezilla-to-upload-files-via-sftp|sftp]] as the cPanel user, then you will start out in ''%%/home/cpuser%%'' so you would be looking for folder ''%%public_html%%'' there. How to fetch the files from the source server may vary based on what if any panel is installed in the source server and how it is configured, but once you have downloaded them, you can upload them to the site's new documentroot in the destination server using ftp.((or sftp or webdav or scp or rsync, if preferred))
  
 +\\
 ===== Copying the Databases ===== ===== Copying the Databases =====
  
-Many types of sites are not composed entirely of files, but rather, also make use of one or more databases. In cPanel, before a database can be imported, it must first be created. If this is your first time creating a database in a cPanel server, it is recommended to use the [[https://documentation.cpanel.net/display/ALD/MySQL+Database+Wizard|MySQL Database Wizard]]. You will need to create both a database and a mysql user for the site, and make sure the mysql user has any needed permissions granted for the database. Make sure to save the database name, database username, and database user's password, since you will need these momentarily.+Many types of sites are not composed entirely of files, but rather, also make use of one or more databases. In cPanel, before a database can be imported, it must first be created. If this is your first time creating a database in a cPanel server, it is recommended to use the ((https://documentation.cpanel.net/display/ALD/MySQL+Database+Wizard))[[https://documentation.cpanel.net/display/ALD/MySQL+Database+Wizard|MySQL Database Wizard]]. You will need to create both a database and a mysql user for the site, and make sure the mysql user has any needed permissions granted for the database. Make sure to save the database name, database username, and database user's password, since you will need these momentarily.
  
 Once the database is created in the new server, you will need to import the data from an sql file. First you will need to export the database in the source server into an sql file. How to do this will depend on what if any panel is installed in the source server and how it is configured. Once you have it, there are a couple of methods to import the file in the new server. Once the database is created in the new server, you will need to import the data from an sql file. First you will need to export the database in the source server into an sql file. How to do this will depend on what if any panel is installed in the source server and how it is configured. Once you have it, there are a couple of methods to import the file in the new server.
Line 26: Line 29:
 If the sql file is small, it may be easier to import it using PhpMyAdmin. But if the database is large, the sql file may be too large to import efficiently in this way. In this case, the recommendation is to upload the sql file to the server and then import it directly into mysql. First, you will need to upload the sql file, for example using ftp. But do not put it in the site's documentroot. It is recommended instead to put it directly into the cPanel user's home directory.((i.e., ''%%/home/cpuser%%'', the folder you will start in if you log into the server via ftp as that cPanel user)) If the sql file is small, it may be easier to import it using PhpMyAdmin. But if the database is large, the sql file may be too large to import efficiently in this way. In this case, the recommendation is to upload the sql file to the server and then import it directly into mysql. First, you will need to upload the sql file, for example using ftp. But do not put it in the site's documentroot. It is recommended instead to put it directly into the cPanel user's home directory.((i.e., ''%%/home/cpuser%%'', the folder you will start in if you log into the server via ftp as that cPanel user))
  
-The next step will require the cPanel account to have either normal shell or jailed shell enabled. This can be checked and adjusted in WHM at Home >> Account Functions >> Manage Shell Access as described [[https://documentation.cpanel.net/display/ALD/Manage+Shell+Access|here]]. After this, you can log into the server via ssh as the cPanel user. If you are using Windows you may want to use PuTTY for this as described [[software:how-can-i-use-putty-software-to-ssh-to-my-cpanel-server|here]], except that instead of logging in as root, it is recommended to log in as the cPanel user.+The next step will require the cPanel account to have either normal shell or jailed shell enabled. This can be checked and adjusted in WHM at Home >> Account Functions >> Manage Shell Access as described ((https://documentation.cpanel.net/display/ALD/Manage+Shell+Access))[[https://documentation.cpanel.net/display/ALD/Manage+Shell+Access|here]]. After this, you can log into the server via ssh as the cPanel user. If you are using Windows you may want to use PuTTY for this as described [[software:how-can-i-use-putty-software-to-ssh-to-my-cpanel-server|here]], except that instead of logging in as root, it is recommended to log in as the cPanel user.
  
 If you log in as the cPanel user, you will already be in the cPanel user's home directory when you log in. If that is where you put the sql file((as was recommended)) then you should be able to see the file in the list when listing the files with ''%%ls -hal%%'' or similar. Then, to import it into mysql, you can use the following command: If you log in as the cPanel user, you will already be in the cPanel user's home directory when you log in. If that is where you put the sql file((as was recommended)) then you should be able to see the file in the list when listing the files with ''%%ls -hal%%'' or similar. Then, to import it into mysql, you can use the following command:
  
 <code> <code>
-# mysql cpuser_db < exporteddb.sql+  # mysql cpuser_db < exporteddb.sql
 </code> </code>
  
Line 39: Line 42:
  
 <code> <code>
-# gunzip exporteddb.sql.gz +  # gunzip exporteddb.sql.gz 
-# bunzip2 exporteddb.sql.bz2 +  # bunzip2 exporteddb.sql.bz2 
-# unzip exporteddb.sql.zip+  # unzip exporteddb.sql.zip
 </code> </code>
  
Line 47: Line 50:
  
 <code> <code>
-define('DB_NAME', 'cpuser_db'); +  define('DB_NAME', 'cpuser_db'); 
-define('DB_USER', 'cpuser_user'); +  define('DB_USER', 'cpuser_user'); 
-define('DB_PASSWORD', 'somepassword'); +  define('DB_PASSWORD', 'somepassword'); 
-define('DB_HOST', 'localhost');+  define('DB_HOST', 'localhost');
 </code> </code>
  
 Sites not using WordPress will have configuration files with different names, possibly in different locations, and the formats of the required lines would likely be different as well. Sites not using WordPress will have configuration files with different names, possibly in different locations, and the formats of the required lines would likely be different as well.
  
 +\\
 ===== Testing the Site ===== ===== Testing the Site =====
  
 It is //strongly// recommended to test the site in the new server //before// changing the dns to point to the new server. You can learn more about how to do this [[dns:how-can-i-test-my-migrated-website-before-changing-the-dns|here]]. Although this page describes the process for Windows first, it does further down the page describe how to do this in recent Mac operating systems. It is //strongly// recommended to test the site in the new server //before// changing the dns to point to the new server. You can learn more about how to do this [[dns:how-can-i-test-my-migrated-website-before-changing-the-dns|here]]. Although this page describes the process for Windows first, it does further down the page describe how to do this in recent Mac operating systems.
  
 +\\
 ===== Copying Emails ===== ===== Copying Emails =====
  
 If there were also email accounts associated with the domain in the source server, you will want to get those copied as well. You can read more about this process [[email:manual-email-migration-guide|here]]. If there were also email accounts associated with the domain in the source server, you will want to get those copied as well. You can read more about this process [[email:manual-email-migration-guide|here]].
  
 +\\
 ===== Wrap-up ===== ===== Wrap-up =====
  
 For most sites, these will cover what you need to remember to copy from the old server, but if your site has things besides this that are necessary for the site to work, you will need to make sure to find and get those copied as well. For most sites, these will cover what you need to remember to copy from the old server, but if your site has things besides this that are necessary for the site to work, you will need to make sure to find and get those copied as well.
  
 +\\
 ===== Changing the DNS ===== ===== Changing the DNS =====
  
 After the site has been tested and confirmed to be working in the new server, you will want to update any needed dns information at the registrar so that the site will be served live from your new server. If this is the domain the nameservers are based on, you may need to [[dns:creating-nameservers|register the nameservers]] if you haven't already. After the site has been tested and confirmed to be working in the new server, you will want to update any needed dns information at the registrar so that the site will be served live from your new server. If this is the domain the nameservers are based on, you may need to [[dns:creating-nameservers|register the nameservers]] if you haven't already.
  
pre-sales/manual-migration.1488112607.txt.gz · Last modified: 2017/02/26 06:36 by mscherf