Move a website and its database to your hosting (WordPress or PHP)
Updated 27 Nov 2026
This guide moves a website by hand: useful when the old host has no cPanel, or you are copying a site from your computer. Moving from another cPanel host? A full cPanel backup is easier: open a ticket and we can move it for you.
What you need from the old site
- The files: everything in the website's folder, as a ZIP. For WordPress: the folder with
wp-config.php,wp-contentandwp-admin. - The database: in the old host's phpMyAdmin, choose the database, open Export, keep Quick and SQL, and press Export. You get a
.sqlfile.
1. Upload the files
- Open cPanel (Services › your hosting › Login to cPanel) › File Manager ›
public_html(or the folder of an addon domain). - Upload the ZIP, then right-click it and Extract.
- Make sure the site's files (for example
index.php) sit directly inpublic_html, not in a folder inside it. Move them up if needed.
More: Upload your website.
2. Create the new database
In MySQL® Databases: create a database, create a user with a strong password, and add the user to the database with ALL PRIVILEGES. Names start with your cPanel username, for example dukabora_wp. Step by step: Create a MySQL database.
3. Import the database
- Open phpMyAdmin, click the new database on the left.
- Open Import, choose your
.sqlfile, press Import (or Go).
A very large file that phpMyAdmin will not take: upload it to your home folder with File Manager, then in cPanel Terminal run:
mysql -u dukabora_wp -p dukabora_wp < ~/backup.sql
4. Connect the site to the new database
WordPress: edit wp-config.php in File Manager:
define( 'DB_NAME', 'dukabora_wp' );
define( 'DB_USER', 'dukabora_wp' );
define( 'DB_PASSWORD', 'the-new-password' );
define( 'DB_HOST', 'localhost' );
Keep the $table_prefix line as it was on the old site.
Other PHP sites: change the same four values in the site's config file (often config.php or .env).
5. Point the domain
Point the domain to your hosting (the nameservers on your hosting page): see Point your domain to your hosting. Then turn on free SSL.
6. Changing the address? (WordPress)
If the site moves to a new domain (or from http:// to https://), WordPress keeps the old address in its database:
- Sign in to
/wp-admin(if it sends you to the old address, change siteurl and home in phpMyAdmin, tablewp_options). - Install a search-and-replace plugin such as Better Search Replace, replace the old address with the new one in all tables, run it once as a dry run first, then for real.
- Open Settings › Permalinks and press Save Changes.
Check
- Pages, images and the admin open on the new hosting.
- Forms and emails work.
- No "Error establishing a database connection": if there is, see this fix.
Kwa Kiswahili
Kuhamisha website: chukua mafaili (ZIP) na database (phpMyAdmin › Export). Kwenye hosting mpya: pakia na Extract kwenye public_html, tengeneza database na mtumiaji (ALL PRIVILEGES), Import faili la .sql kwenye phpMyAdmin, kisha badilisha jina la database, mtumiaji na password kwenye wp-config.php.
Still need help? Open a ticket and we will reply.