The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Client: Howto Move A cP site without help.

Discussion in 'General Discussion' started by mccmikey, Jul 7, 2003.

  1. mccmikey

    mccmikey Member

    Joined:
    Sep 21, 2002
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Scenario 1:

    You have a cPanel site that you want to move to another host without assistance.

    Scenario 2:

    Your new host could not migrate your site, with errors like the one at http://forums.cpanel.net/showthread.php?s=&threadid=11756

    ---------------------------
    Note: This is not a 100% perfect copy method, and should only be used if all else fails.


    Step 1: Create or obtain a hosting account with at least the same size account as the current one. Take note of the IP address and cpanel username and password - use the same username on both sites.

    Step 2: In source cPanel, perform a full backup, but choose FTP instead of Home Directory, and feed it the relevant destination IP address, username and password as matches those in step 1.

    * note * there may be problems if the backup file's size exceeds the free disk space - typically the backup will take about 30% of the original site size - a 700 meg site will back up to around 300 meg. (Unless it's full of MP3s and zip / compressed EXE files.)

    Step 3: Extract the backup file on your new host - this will place everything in a subdirectory - including some files you don't normally see in cPanel. (Use the cPanel file manager)

    Step 4: If you have email accounts that you cannot remember the passwords for, you can typically extract about 70% of them. Download the shadow file using FTP set to ASCII. [Normally you will find the shadow file in (backupname)/homedir/etc/] To extract the passwords you will need a brute force password cracker - a simple DOS program called "John The Ripper" or "John-16" can help there - and of course the faster the cpu the less time it will take.

    Step 5: Using cPanel's File manager, you can restore all the stuff in the public_html folder in the archive to the public_html folder off your root. (You may have to do it a folder at a time, and use FTP to do the files in the root of public_html if there are alot of them.) File permissions seem to come across without dramas, and php-based systems (forums, e107, nuke, etc) should bounce back no worries once you bring the databases across (separate step)

    Step 6: To restore MySQL databases, you will need to back them up from the old host. Go in to phpMyAdmin on the old host, and for each database you need, click on the database in the left pane, then choose Export; select all; Structure and Data; Save to File - and this will begin a download of the entire database in sql form.

    Step 7: To recreate MySQL databases on the new host, you will need to create empty databases using the "Manage MySQL" link in cPanel. You'll also need to recreate users for those databases. If you're not sure what your usernames or passwords were for these, have a look at the config.php files in your public_html folders for the relevant progies - for example phpBB's config.php lists in plain text the database names, usernames, passwords, etc. (Of course you can change these config files instead later on - also not all programs will necessarily have a file called config.php)

    Step 8: To restore the databases from the sql backups you made from the old host, select the database in phpMyAdmin, choose SQL, and choose the "from file" option - browse for your blah_blah.sql file and upload. (Might take a while for bigger sites.)
    If this goes to plan, you'll see a message something like "The SQL server processed your commands and generated 1,000 records", or something like that :)

    Step 9: By now "John The Ripper" should have figured out some of your passwords. If you cant scroll to view them, read the 'examples' file for how to view the results. You will now need to recreate all the mailboxes manually. If you have many to do (I had 220) you might find the fastest way to enter the info is to go to cPanel's add account page, add an account, click back, add an account, click back, and repeat until all done. If you have heaps to do, you might prefer to set up a macro in a program like Iolo MacroMagic to do the work for you - of course it takes a little while to write the macro too, so whichever evil is lesser :) For those you don't know the password, you will have to make a new one :( {PS - for DialUp users, Opera is much faster displaying most cPanel pages than IE due to different rendering engines.}

    Step 10: Now you have a stack of mailboxes created, but they're all empty. Hopefully your new server is not live yet, so the next step won't result in email loss.

    Aim: Copy the inbox files from the backup.

    Method: Locate the first inbox to be copied. This should be in (backupname)\homedir\mail\(domain.net)\(mailbox)

    In there you'll find a file called inbox

    You want to copy that file to \mail\(domain.net)\(mailbox) - which you can do in cPanel's file manager. Now, just before you do the final click to choose where to place the copy, right click the link and choose copy to clipboard. It'll look something like this..

    Paste the clipboard into a notepad file - and if it looks right, open a new browser window and paste it - all being well you'll see a message saying file copied successfully.

    Now, if you've got a few to do, it might help to create an Excel formula to do the substituting of "someguy" with the mailbox names you want to copy.

    Example: A3 is the username
    A4 is the following:

    That way you just type the name into A3, press enter. A4 is highlighted, so press Ctrl+C (copies to clipboard) then go to your address bar in your browser and choose Ctrl+V (paste) [A utility like NailIt which can force windows on top of others might be useful to download.]

    Step 11: Changing Permissions.

    OK so now you've copied all these mailboxes, but their permissions have become _rw_r____ - and unless changed, they will not accept new messages. For this final step, you need an FTP client (or some lack of sanity) to change the permissions. I use FTP Surfer for this purpose, although ws_ftp might also do the job just as fast. [Note: FTP Surfer is incompatible with cPanel as it cannot understand the 426-(quota) messages and assumes the transfer failed - but is fine for permission changing.] Oh, and the permissions you want are _rw_rw____

    Hopefully, now all you need to do is change your nameservers with your registrar, and in 24 hours you'll be live.

    Final tip: If your new host does not allow viewing a site via IP address (ie http://123.234.32.123/~username) then you can work around this by editing the hosts. file in windows - and add the IP and name of your site. You can then check that HTML is working OK before the DNS changes are made :)

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
     
  2. NeutralGold

    NeutralGold Well-Known Member

    Joined:
    Jun 5, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    That was awful nice of you to go through all that trouble, even though I don't need this information, I'm giving you props on taking the time to type this up.:D

    cPanel.net Support Ticket Number:
     
  3. triatma

    triatma Member

    Joined:
    Apr 21, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    kudos

    this is a great gesture !!! keep it up.

    cPanel.net Support Ticket Number:
     
  4. NeutralGold

    NeutralGold Well-Known Member

    Joined:
    Jun 5, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    -Bump- Sticky request please..

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page