Activity Stream
48,167 MEMBERS
62912 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default How to: Migrate your website

    How to: Migrate your Website

    Hey, welcome to my tutorial on how to migrate your Website, you must have SHH access for this tutorial to work on your server

    Lots of us had to migrate their websites in one way or another, even tho the clients usually leave this to their host, and your host might take longer than you the time you need, the process is very easy itself, which makes your website migration process faster and you need just a average knowledge of Linux

    This tutorial will be covering two aspects, Migrating your website from one host to another, and migrating your Website from your Localhost to a host.

    Migrating your website from one host to another

    Start by taking a look around and trying to navigate to your web directory. Type:
    Code: 
    ls
    To ?list? the current files and folders.
    Code: 
    cd directoryname
    to change to a directory. In this case, I?m going to navigate to the httpdocs directory, which is the root of my web site (where all my wordpress files are stored). You can then ?ls? again, just to be sure.

    Backing up your Website

    First log in to your old server via SSH, You should have root access
    Change directories to the directory where your website files are.
    Type in the following code:
    Code: 
    tar -cpzf backup.tar.gz
    This creates a tar file of all files in that directory.

    Backing up the Database:

    First off, you?ll need 3 bits of information to backup your database, but all can be found within wp-config.php (if you?re running wordpress, that is):

    Database name
    Database user
    Database password

    Then, execute this simple command, being sure to replace the username, table name, and backup filename where neccessary:

    Code: 
    mysqldump --add-drop-table -u username -p tablename > backupfilename.sql
    Hit enter, and enter your password. Once it?s run, you can then execute another ?ls? command to check that the file has been output. Congratulations, this is all the information in your database as a single SQL file, ready to backup or import somewhere else.
    Note: I?ve assumed that your database server is running on the same server on which you are hosting. On a GoDaddy host however, the MySQL database is actually stored remotely on a separate server to which you don?t have SSH access. In cases like these, you will need to access PHPMyAdmin via the hosting control panel, but that is out of the scope of this tutorial.

    Backing Up Files:

    Now that we have the database stored to single file on the server, we can go ahead and backup both that and your website files down to a single compressed backup file. To do this, we are going to execute one simple command. You need only replace yourbackupfilename with whatever you want it to be called.
    Code: 
    tar
    Code: 
     -vcf yourbackupfilename.tar .
    Let me break that down. Tar is a common linux compression format, similar to zip but more efficient. -vcf are simple some options that say ?make a new archive, and tell me what you?re doing?. Next is the name of the file we want to create, and finally a single period mark tells it to include everything. We could have written * instead, but this would miss any hidden files such .htaccess which is essential for WordPress.
    That?s it. Once that?s run, you will have a single .tar file consisting of every file on your site. You could log in via FTP at this point and download it, but let me show one final step that allows you to restore all these files.

    Restoring your Backup

    Let?s say the worst has happened, and something has gone horribly wrong with your site. You?ve got a tar file of everything that you backed up last week, so now you?d like to restore it to that. First off, log in via FTP and upload the backup file onto your server. Perhaps you?ve been storing them in a special directory. Either way, move the latest complete backup file into the root of your site, and we?ll begin.

    Start by unpacking all the files, the reverse of what we did to back them up:
    Code: 
    tar
    Code: 
     -vxf yourbackupfilename.tar
    The crucial difference here is in the -vxf switch, which tells it to extract the files instead of creating a new backup. Also, there is no period on the end of the command this time.
    The last step is to suck your database back in to where it was before. Make sure you have a blank database setup with the same password and tablename as before, or you?ll need to change your site configuration settings too.
    To suck the data back in, execute this command:
    Code: 
    mysql -u username -p tablename < databasebackupfilename.sql
    Migrating from your localhost to a live host

    If you have created your website and done everything via your localhost and now you just need to move it to a live host then follow the below steps:

    Backup your websites files, database files too.

    Backing up your MySQL Database:

    Go through your local PHPMyAdmin:
    Click on the database name and click the "Export" tab
    Scroll down and click "Save as file", then click "Go".
    Save that file somewhere safe.
    See this page for screenshots and details.

    Check the database in PHPMyAdmin and make sure the collation is UTF-8

    Do this before you install any WordPress or anything that adds tables to the database.
    (Then the tables will be created with the right collation, and Tibetan should work fine.)
    Login on your cPanel
    Scroll down to "Databases"
    go to PHPMyAdmin and click on the new database name
    click on the "Operations" tab, scroll down to "Collation"
    if the menu there does not already show utf8_general_ci then
    click on the menu and select utf8_general_ci
    click on Go

    That's all, after following these steps you should have your website moved to a new host

    Raptile Reviewed by Raptile on . How to: Migrate your website How to: Migrate your Website Hey, welcome to my tutorial on how to migrate your Website, you must have SHH access for this tutorial to work on your server Lots of us had to migrate their websites in one way or another, even tho the clients usually leave this to their host, and your host might take longer than you the time you need, the process is very easy itself, which makes your website migration process faster and you need just a average knowledge of Linux This tutorial will be Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Banned
    Website's:
    xsl.tel xsltel.com
    what about mysql database ??

  4.     
    #3
    Member
    I've also clarified that while you posted..

  5.     
    #4
    Member
    If I forgot database password what can I do ?

  6.     
    #5
    Banned
    Website's:
    HotWallpapers.me AustraliaFlood.net VirtualUpload.net
    Thanks for share bro

  7.     
    #6
    Member
    Quote Originally Posted by 3xupdate View Post
    If I forgot database password what can I do ?
    If its a WordPress installation you can just see the e-mail you used for the installation, you should find all the details over there..

    Good luck

  8.     
    #7
    Member
    Website's:
    ihide.info
    What about migrating from Localhost to a Live Server that be a great part to add in.

    only difference is that you have to edit your SQL file by doing a search and replace on localhost to whatever your domain name is.
    KWWH has turned gay. I will not return until Phamous is demoted.

  9.     
    #8
    Member
    I've also explained about Migrating from Localhost to a Live Server, thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How-to: Migrate Accounts From One Server To Another (cPanel)
    By Bharat in forum Tutorials and Guides
    Replies: 0
    Last Post: 6th Oct 2011, 12:50 PM
  2. How to migrate vbulletin 4 to new server
    By babarali124 in forum Technical Help Desk Support
    Replies: 2
    Last Post: 22nd Jul 2011, 05:42 PM
  3. Replies: 2
    Last Post: 3rd Mar 2010, 09:43 AM
  4. Replies: 0
    Last Post: 7th Aug 2009, 08:49 AM
  5. Replies: 0
    Last Post: 3rd Jul 2009, 11:50 PM

Tags for this Thread

BE SOCIAL