Joseph McGraw
Joseph McGraw

Reputation: 1

Client wants to swap account data between two different accounts hosted with WHM/cPanel

I have a client with two different cPanel accounts hosted on my server under WHM running CentOS.

Account A is hosted with its own IP address and domain name and is the current 'live' website. The site is running a custom Laravel backend with an attached MySQL database.

Account B is hosted as a vps using the servers main IP address with a different domain name and is the 'test' site. The site is running wordpress with an attached database.

Both domain names are hosted on godaddy under the same account.

The client wants the test account B to be hosted under the live account A's IP and domain name, and the live account A to be hosted under account B's IP and domain name, effectively 'swapping' the test site to be the live site. They want little to no downtime in this swap.

The main problem is neither I nor the client know how to do this swap with little to no downtime. Is it possible or is downtime inevitable?

Upvotes: 0

Views: 248

Answers (1)

Howard E
Howard E

Reputation: 5649

To copy wordpress from 1 cpanel to another:

  1. Access the cPanel for the new site. Create an empty DB using the "MYSQL Databases" option.
  2. Add user to DB and Grant All.
  3. Access WHM and then PHPMYADMIN as Root.
  4. on Old Database (in PHPMYADMIN), click on DB name then operations.
  5. Copy Database to (New DB Name) Structure and Data - uncheck Create Database before copying.
  6. Copy Contents of WP From old (/home/account-name/public_html/) to /home/new-account/public_html.
  7. Update wp-config.php to reflect new database info.
  8. From Linux CLI, CHOWN -R new-account:new-account /home/new-account/public_html/. - make sure that public_html itself is owned by "GROUP: nobody" and "Owner: new-account"m but everything underneath that is owned by group and owner "new-account"
  9. Update New DB to New URL's - you can find replace in the databse, or use this great tool - https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Upvotes: 1

Related Questions