Primal Habits
It is currently Thu Mar 30, 2017 12:46 am


Feed

Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Move Website via SSH
PostPosted: Mon Nov 29, 2010 1:46 pm 
Offline
User avatar

Joined: Sun Apr 25, 2010 1:02 pm
Posts: 115



How to move your website if both hosts offer SSH
If you need to move your website, and your former host offers SSH - you can do so easily and very quickly using SSH.

First you will need to log into SiteAdmin/WHM/cPanel and enable SSH for your hosting plan on your server.

If you have a database
If you have a database(s), prior to creating your website file archive you will need to create a backup for each placing the dump files in your web root directory so it is also archived.

Creating Your Archive
The first step is to make your backups at the host you will be leaving. The first backup will be of your website files. To do this you will SSH to your old host. If you do not know your username/password to SSH to your old host, you will need to contact them to retrieve this information.

Once you are logged in you will need to move to your web directory, typically: public_html, www, or htdocs directory. (we used public_html in the example below).


Code:
Please Login or Register, to see this Content


You are now ready to make your tarball archive, at the prompt type.

Code:
Please Login or Register, to see this Content


ie.

Code:
Please Login or Register, to see this Content


The above command will create a file in the name you chose within your public_html directory. The flags "cpzf" will create a tar file of all the files within public_html, preserving the permissions of the files, into a gz compressed tar file. Do not forget the trailing "*", as that states "all" and without it your archive will fail. Download this file so you have a local backup of your website (You should always try to maintain a local backup of our site in case there is an issue with your hosts backup!).

Please note, this archive will **NOT** include any databases, email or files outside of your web readable directory (Such as .htpasswd files).

Moving your files
Once your archive has been created you can then login to your hosting via SSH and copy the file to your server.

Once you have logged in, you will need to switch to the directory you would like to place the archive (Most use public_html).

Code:
Please Login or Register, to see this Content


You will then transfer the file from your previos host.

Code:
Please Login or Register, to see this Content


Where "web-access-to-my-old-web-site" is your former hosts IP address, your domain (if you have not yet updated your DNS to your new server), or their domain/~username - whatever method they provide for you to access your site when there is no DNS active to their servers.

Once your transfer is complete, you will then uncompress your archive.

Code:
Please Login or Register, to see this Content


You just moved your site via SSH. Please check it either through your domain name (if your DNS is active to our servers) or through your hosting plans IP address.

The switches xzf in this command are extract, gzip, file.

_________________
Check Out RouterHead8080 T.V.



Share on FacebookShare on TwitterShare on TuentiShare on SonicoShare on FriendFeedShare on OrkutShare on DiggShare on MySpaceShare on DeliciousShare on Technorati
Top
 Profile  
 
 Post subject: Re: Move Website via SSH
PostPosted: Tue Jan 17, 2012 11:54 am 
Offline
User avatar

Joined: Fri Apr 30, 2010 6:10 pm
Posts: 18
Does anyone know how to do a mysql dump file of my website database?


Top
 Profile  
 
 Post subject: Re: Move Website via SSH
PostPosted: Tue Jan 17, 2012 12:01 pm 
Offline
User avatar

Joined: Sun Apr 25, 2010 1:02 pm
Posts: 115
Kottonmouth801 wrote:
Does anyone know how to do a mysql dump file of my website database?


I use this method.
Article.

Some more about original post.
This may also be used to change ownership of files after uncompressed.
Code:
Please Login or Register, to see this Content


As stated in this article.

if you need to change ownership of the files see this article.

_________________
Check Out RouterHead8080 T.V.


Top
 Profile  
 
 Post subject: Re: Move Website via SSH
PostPosted: Tue May 01, 2012 9:02 pm 
Offline
User avatar

Joined: Sun Apr 25, 2010 1:02 pm
Posts: 115
Also the following commands should work.

Code:
Please Login or Register, to see this Content


Code:
Please Login or Register, to see this Content


Code:
Please Login or Register, to see this Content


And this code should restore the dump file.
Code:
Please Login or Register, to see this Content

_________________
Check Out RouterHead8080 T.V.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours [ DST ]


Related topics
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to Get Your Website Preview Thumbnail to Show Up on Face

RouterHead8080

0

2193

Mon Jun 28, 2010 8:28 pm

RouterHead8080 View the latest post

 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

Affiliates    Terms of use    Privacy policy   

Primal Habits, a Sceptersoft Company
Copyright © 2010 - 2017 Sceptersoft LLC. All rights reserved.