Posts Tagged ‘Cpanel’

How to restore a Cpanel backup to a different server.

November 14th, 2009

This tutorial explains a simple, straightforward method for migrating cPanel accounts from one server to another. You can use this method to transfer accounts from an old server to a new one, help customers from another host move to your host, etc. This does not even require root access on one end of the migration. Basically, this is a more reliable method than the “Transfer Account from another Server” tool in WHM, which rarely works.

Requirements:
- cPanel on both servers
- WHM access on the new server (one that the accounts are being moved to)
- root access on the new server

Definitions
The server you are transferring the accounts from = “old server”
The server you are transferring the accounts to = “new server”

Instructions
1. Log into WHM of your new server and create a new account called “restore”, or anything you like for that matter. Remember the FTP address, username (‘restore’, in this example), and account password. We will need these for later.

2. Log into the cPanel account you are wanting to transfer on the old server.

3. Click on “Backup >> Generate/Download a Full Backup”.

4. Once here, select the backup destination to be “Remote FTP Server”.

5. Enter your email address for verification, followed by all of the FTP account information for “restore”, which we created on the new server.

-Remote Server: new server’s address
-Remote User: restore
-Remote Password: restore’s password
-Port: 21

Then, click “Generate Backup”. This may take some time to backup the files, depending on how large the account is. You should receive an email provided in the above info once it is complete.

6. Now, log into SSH on your new server.

7. Type in the following commands:

cd /home/restore/public_html

ls

After running the list command above (ls), you should see the tar file of the account on the old server. This means that you have successfully sent the file via FTP to your new server.

8. Now move the tar file to your new server’s /home directory with the following command:

mv tar_file_name /home

9. Now, log into WHM on your new server and navigate to “Backup >> Restore a Full Backup/cpmove file”

Once here, you should see the old account’s username under “Possible cpmove archives found:”.
If you do not, log back into SSH and be sure that the account’s tar file has been moved into /home.

10. Type in the account name in the text field in WHM, which is proceeded by “Enter the username for the account you wish to restore:”.

11. Click “Restore”.

12. Repeat process for additional accounts.

Correct Cpanel’s Easyapache Update Error

October 1st, 2009

If you’ve every attempted to upgrade / update cpanel via easyapache via the control panel or shell access and return the following erorr, changes are the rpm database is corrupt and needs to be rebuilt;

!! Package system can not be repaired automatically !!
!! Please visit http://www.cpanel.net/support/could_not_ensurepkgs.htm for help with this error. !!
!! Restoring original working apache !!

To correct this, you simply need to check to make sure that yum and any rpm’s are not running by doing the following;

ps auxwww | grep yum
ps auxwww | grep rpm

After that, you need to do the following;

rm /var/lib/rpm/__db.* -rf
rpm -rebuilddb

This will rebuilt the rpm database and depending on what needs to be updated it can take some time to update. Once this is done however you should be able to run easyapache without error.

Accounts missing from WHM (Cpanel)

July 14th, 2009

If you notice that an account is missing from your WHM instance and you’ve already attempted to fix this by running /scripts/rebuildcpusers (you have tried this, correct?), then the issue lies in the /etc/trueuserdomains file. To correct this you will need to manually edit this file (using VI, Nano, Pico) and add the domain and the user account assigned to that domain. For example;

My user is Myuser(it really isn’t) and the domain is Mywebsite.com. I would edit this in the file by added it as such:

Mywebsite.com: Myuser

Once this is done, save the file and restart cpanel. Once you access WHM, the directory will appear again.

Fantastico is unable to connect to your MySQL server at this time.

March 13th, 2009

Error: Fantastico is unable to connect to your MySQL server at this time.

If you are trying to access your Fantastico instance and are not able to access it, there are several things you can try;

This problem can be caused by a wide variety of issues, please run through the following checklist:

1.) Restart MySQL on your server. Watch for errors. If MySQL doesn’t restart successfully, skip to #5 and try that next. (Note that in some rare instances, clients report the need to restart their server to get MySQL working properly.)
2.) The cPanel account is out of disk space or out of available mysql slots. Increase one or both of these and try again.
3.) The cPanel account account reports plenty of available disk space and mysql slots, but the user data/plan assignment is corrupt. Try assigning the account to a new featureset/hosting plan and see if that resolves it. If so, you may need to recreate or reassign the original plan to get things working again.
4.) The server itself is out of disk space on one or more partitions. Clean out unneeded files or accounts in this case.
5.) MySQL is malfunctioning on the server or the Perl DBD module is corrupt or missing. Run /scripts/mysqlup –force via SSH as root and watch for errors if any.
6.) The backend version of PHP is corrupt. Check the items here for a resolution:

http://netenberg.com/forum/viewtopic.php?t=1960.0

7.) If this only affects a single account, the account data may be corrupt. Do a full backup of the account, terminate it and then use the full backup to restore the account.
8.) Ensure your server is running Perl 5.8.8 (or whatever the latest approved version from cPanel Inc. happens to be — see http://layer1.cpanel.net/ ). Fantastico does not use Perl, but cPanel uses it extensively and if Perl isn’t a recent version, cPanel and thus Fantastico will have problems.
9.) Ensure you’re using the latest version of cPanel for your preferred build track. Run /scripts/upcp –force (or force the cPanel update from WHM) to make sure all files are installed and are the latest versions. If you run EDGE, try backing down to Current, Release or Stable and see if that helps.
10.) If all else fails, try removing Fantastico:

http://www.netenberg.com/forum/index.php?topic=3164.0

and reinstalling it:

http://www.netenberg.com/forum/index.php?topic=950.0

HOWEVER!!!!!!!

Before you try any of those recomended fixes, simply SSH to the server and goto /usr/local/cpanel/3rdparty/fantastico/includes/mysqlconfig.php and look for the following;

if ( ‘mysqlconfig.php’ == basename ( $_SERVER['PHP_SELF'] ) ) { die ( __FILE__ ) ; }

$MYSQLHOST = “127.0.0.1″ ;
$MYSQLPATH = “mysql” ;
If the path shows $MYSQLHOST = “localhost” , it needs to be changed to $MYSQLHOST = “127.0.0.1″ and save it in the file and also into a file called mysqlconfig.local.php (if doesn’t exist, create it).

Once you do this, you can restart mysql and Fantastico should connect again.

Mysql fails to start on a Cpanel linux server.

February 7th, 2009

If mysql service is failing upon start, you will have to place the following code in /etc/my.cnf under ‘mysqld’ section and restart mysql service.

skip-innodb” (Do not add the quotes).