How to Prepare Website Files and Databases for Migration
Moving a website to a new hosting provider can improve its reliability, performance or support experience, but a migration should not begin with copying files at random. Website files and databases work together, and missing one important component can lead to broken pages, lost content, failed logins or an unavailable website.
For a Nigerian small business, entrepreneur or organisation, careful preparation is especially important when the website supports customer enquiries, online sales, business email or professional credibility. The goal is not simply to move data. It is to move the website with its content, settings, domain connections and essential access under your control.
Understand what needs to move
A typical website migration may involve several separate assets:
- Website files: These include application files, themes, plugins, images, documents, scripts and configuration files.
- Database: A database stores changing content such as pages, posts, product information, user accounts, comments and website settings.
- Domain: The domain name directs visitors to the website, but it is separate from the hosting account.
- Email: Domain-based addresses such as [email protected] may use different mail settings from the website.
- DNS records: These tell browsers and email services where to find the website and mailboxes.
- SSL configuration: HTTPS settings need to be available on the new hosting environment.
Not every migration involves all these items. For example, you may move website hosting while leaving email with its existing provider. Decide this before changing DNS records, because an incorrect change can interrupt business email even when the website migration itself is successful.
Confirm ownership and access first
Before downloading anything, make a list of the accounts involved. You should know who controls the domain registrar account, current hosting account, website administration account, database access and email service.
Business owners should retain access to these essential digital assets rather than relying only on a former developer, employee or third party. Confirm that the domain registration details and recovery email are accurate. Check the domain’s renewal status and ensure that any transfer or security restrictions are understood before migration.
Also record the current hosting details, including:
- Hosting control panel login
- File transfer access, such as SFTP or another available method
- Database name, username and password
- PHP or application version, if relevant
- Current DNS records
- WordPress administrator access, if the site uses WordPress
Do not publish passwords in a document shared widely with a team. Store credentials securely and change temporary passwords after the migration is complete.
Create a complete backup
A backup should be created before making changes to the existing website. Ideally, keep more than one copy and store at least one copy separately from the current hosting account. A backup that exists only on the server being migrated may be lost if that account becomes inaccessible.
For a database-driven site, a complete backup normally includes both the website files and a database export. Downloading only the visible images or public pages is not enough. You may also need configuration files, hidden files and folders used by the application.
Label the backup clearly with the website name and date. Then check that the files can be opened and that the database export is not empty or unusually small. A backup is more useful when you know what it contains and how it would be restored.
For WordPress websites
A WordPress backup should generally include the WordPress files, the wp-content folder and the database. The wp-content folder contains themes, plugins and uploaded media, while the database contains posts, pages, settings and other site information.
Review the plugins and themes before migration. Remove unused extensions where appropriate, update carefully, and make a note of any plugin that handles caching, security, redirects, backups or contact forms. These can affect the way the website behaves on a new server.
Export and prepare the database
The database export is often created through a hosting control panel or a database management tool. The exact process depends on the hosting environment, but the important outcome is a usable export containing the website’s tables and data.
Before exporting, consider the following:
- Check that the correct database is selected, especially if several websites share one hosting account.
- Record the database name, username and password used by the website configuration.
- Allow the export to include the tables required by the application.
- Use a suitable export format provided by the database tool.
- Keep the original database unchanged until the new copy has been tested.
Large databases may need special handling. An export can time out when performed through a browser-based tool, or a large import may exceed limits on the new hosting account. In that situation, ask the new host about supported import methods rather than repeatedly attempting an incomplete transfer.
Check configuration files carefully
Website configuration files often contain the connection details that link the files to the database. They may also contain security keys, caching rules, directory settings or application-specific values.
Do not edit these files without keeping an original copy. When the website is moved, database credentials, file paths or server-specific settings may need to change. A small typing error can produce a database connection error or a blank page.
Configuration files can also contain sensitive information. Transfer them securely and avoid sending them through unsecured public channels. If credentials were exposed during the process, replace them after the migration.
Record DNS and email settings
Before changing the domain’s DNS, save a copy of the existing records. Common records include those for the website, email delivery, subdomains and verification services.
This step is essential when the same domain is used for business email. If you move the website but accidentally remove or replace mail records, messages may stop arriving. The safest approach is to change only the records required for the website and leave email-related records unchanged unless email is also being migrated.
Tell colleagues or service providers about the planned change if they manage email, payment tools, analytics or other services connected to the domain. Keep a record of which service controls each part of the setup.
Prepare the new hosting account
Before uploading the website, confirm that the new hosting environment can support it. Consider the application requirements, storage needs, database type, email requirements, SSL support and expected visitor traffic. A small brochure website may need a different arrangement from a busy online store or a website with several mailboxes.
For WordPress, confirm that the new environment supports the required WordPress version and the versions used by the website’s themes and plugins. If the site needs managed WordPress support, clarify which maintenance responsibilities are included and which remain with the website owner.
Create the required database and user on the new hosting account, then apply the appropriate permissions. Upload the files to the correct web directory and import the database using the method supported by the new host.
Test before directing visitors to the new server
Do not wait until the DNS change to discover that the website is broken. Use a temporary preview address or another testing method provided by the hosting provider. The exact preview method varies, but the principle is the same: test the new copy while the existing website remains available.
Check important functions rather than only opening the homepage:
- Open several pages and posts.
- Test navigation, images, downloads and internal links.
- Log in to the administration area.
- Submit contact forms and confirm where messages are delivered.
- Test shopping carts, payments or bookings if applicable.
- Check mobile layouts, since many visitors in Nigeria and West Africa access websites primarily through mobile devices.
- Confirm that HTTPS works and that browsers do not show security warnings.
- Review redirects and important error pages.
For a business website, submit a real but low-risk test enquiry and confirm that the recipient receives it. If the website uses domain-based email, test both sending and receiving without altering the existing mail settings unnecessarily.
Change DNS and monitor the migration
Once the new website has been tested, update the relevant DNS record or nameservers according to the migration plan. DNS changes may not appear everywhere immediately because different networks and devices can temporarily use cached information.
Keep the old hosting account active until the new website is working consistently and you have confirmed that important data is present. Monitor the website, forms, logins and email during this period. Do not cancel the old service simply because the domain begins displaying the new server.
Keep a migration record
Save the final backup, DNS record list, access details, test results and date of the change in a secure location. Note any settings that were changed and who is responsible for future renewals, backups and updates.
A successful migration is more than a website appearing at a new address. It means the files and database are complete, the domain remains under the business’s control, email continues working, HTTPS is active and the owner has a reliable recovery path.
The practical takeaway: prepare first, back up both files and database, protect email settings, test before changing DNS and keep control of your domain and hosting accounts. If the technical steps feel unclear, a hosting provider such as Sonhosting can handle the complicated parts while explaining what is being moved and why.


