tutorials:server:migration:ssh_method

Differences

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

Link to this comparison view

Next revision
Previous revision
tutorials:server:migration:ssh_method [2012/10/12 23:39]
jonyo created
tutorials:server:migration:ssh_method [2014/09/25 16:55] (current)
Line 5: Line 5:
 This tutorial is a sub-section of the main [[tutorials:server:migration:start]] instructions.  You can follow this tutorial as part of **Step 1: Moving Files**. This tutorial is a sub-section of the main [[tutorials:server:migration:start]] instructions.  You can follow this tutorial as part of **Step 1: Moving Files**.
  
-<tip c w>**Warning:**  This option is only for advanced users that are **familiar with SSH** and have **SSH access** on both the "from" and "to" locations, and ability to use SCP to directly transfer a file from one location to the other.  This also means that both locations must be on Linux based servers, since SSH is not available for Windows servers.  If you are not sure how to use SSH we recommend to use the option [[#Option 2: Use FTP to move from one folder or server to another]] instead.</tip>+<tip c w>**Warning:**  This option is only for advanced users that are **familiar with SSH** and have **SSH access** on both the "from" and "to" locations, and ability to use SCP to directly transfer a file from one location to the other.  This also means that both locations must be on Linux based servers, since SSH is not available for Windows servers.  If you are not sure how to use SSH we recommend to use the option [[tutorials:server:migration:start#Option 2: Use FTP to move from one folder or server to another]] instead.</tip>
  
-Only use this method if you are **comfortable with using SSH and the command line**, and you have SSH access for both the "from" location and the "to" location.  Otherwise stick to the standard FTP instructions mentioned in [[#Option 2: Use FTP to move from one folder or server to another]].+Only use this method if you are **comfortable with using SSH and the command line**, and you have SSH access for both the "from" location and the "to" location.  Otherwise stick to the standard FTP instructions mentioned in [[tutorials:server:migration:start#Option 2: Use FTP to move from one folder or server to another]].
  
-This is accomplishing the same "end result" as the [[#Option 2: Use FTP to move from one folder or server to another]] option, you will be copying the files from one location to the other, but "how they get there" is much different((And if you enjoy this sort of thing, much more fun as well!)).  However if you are able to use SSH on the from and to locations, this option is much faster and more reliable since you only transfer a single large zipped file directly from one location to the other, instead of downloading and uploading the files one by one using FTP.+This is accomplishing the same "end result" as the [[tutorials:server:migration:start#Option 2: Use FTP to move from one folder or server to another]] option, you will be copying the files from one location to the other, but "how they get there" is much different((And if you enjoy this sort of thing, much more fun as well!)).  However if you are able to use SSH on the from and to locations, this option is much faster and more reliable since you only transfer a single large zipped file directly from one location to the other, instead of downloading and uploading the files one by one using FTP.
  
 This is the overall steps you will be following: First, SSH into the "from" location, zip up the entire contents of the folder that the software is installed in.  Then while in the "from" location still, use SCP to transfer the zipped file to the other location.  Then SSH to the "to" location, move the zip file to the folder that the files should be installed in, and unzip. This is the overall steps you will be following: First, SSH into the "from" location, zip up the entire contents of the folder that the software is installed in.  Then while in the "from" location still, use SCP to transfer the zipped file to the other location.  Then SSH to the "to" location, move the zip file to the folder that the files should be installed in, and unzip.
Line 24: Line 24:
   - Make sure the **geodesic_files.tar.gz** file exists in the folder.  If not you may have transferred it to the wrong folder, in which case figure out where you copied it to, and copy it into the correct folder or re-transfer the file using SCP.  Then unzip the file using<code bash>tar -zxvf geodesic_files.tar.gz</code><   - Make sure the **geodesic_files.tar.gz** file exists in the folder.  If not you may have transferred it to the wrong folder, in which case figure out where you copied it to, and copy it into the correct folder or re-transfer the file using SCP.  Then unzip the file using<code bash>tar -zxvf geodesic_files.tar.gz</code><
   - Delete the contents of templates_c folder, using <code bash>rm -Rf templates_c/*</code> <   - Delete the contents of templates_c folder, using <code bash>rm -Rf templates_c/*</code> <
-  - You may wish to use FTP to download a copy of the **geodesic_files.tar.gz** file for backup purposes.  Once you have downloaded a copy, be sure to **delete the file** from **both locations** using FTP (or SSH), as it could be a security risk to keep it somewhere that can be downloaded from the web. < +  - Make sure the folders and contents are writable, by chmod 777 on new location <code bash>chmod 0777 geo_templates/ user_images/ _geocache/ templates_c/ -R</code>
-  - That's it!  Continue on to the next step [[#Step 2 - Create Database]]  <+  - You may wish to use FTP to download a copy of the **geodesic_files.tar.gz** file onto your location computer for backup purposes, and to make it easy to "start over" on the migration if something goes wrong in the steps ahead.  Once you have downloaded a copy, be sure to **delete the file** from **both locations** using FTP (or SSH), as it could be a security risk to keep it somewhere that can be downloaded from the web. < 
 +  - That's it!  Continue on to the next step [[tutorials:server:migration:start#Step 2 - Create Database]]  <
  
  
 +===== All SSH commands =====
 +
 +Below are all of the SSH commands to run, these are extracted from the steps above and combined for your easy reference and removal of the explanations.  Note that you will need to make adjustments in some cases such as to folder or domains used.  If you aren't sure what needs to be changed, stick to following it step by step in the instructions above.
 +
 +<code bash>cd public_html/classifieds/
 +tar -zcvf geodesic_files.tar.gz .
 +scp geodesic_files.tar.gz [email protected]:/home/username/public_html/
 +# Enter password when prompted
 +ssh [email protected]
 +# Enter password when prompted
 +cd /home/username/public_html/
 +tar -zxvf geodesic_files.tar.gz
 +rm -Rf templates_c/*
 +chmod 0777 geo_templates/ user_images/ _geocache/ templates_c/ -R</code>
tutorials/server/migration/ssh_method.1350085194.txt.gz · Last modified: 2014/09/25 16:55 (external edit)