After migrating a website to Hostek, you must update the application's configuration files to point to the new database credentials. This ensures the website can successfully connect to the new database and display content correctly.
Important: Failure to update these credentials after a migration will result in a "Database Connection Error" or a similar failure to load the site.
Before you begin
You will need:
Access to the website's file system (via FTP, SFTP, or a File Manager)
The new database name, username, and password provided by Hostek
The local IP address or hostname of the database server (usually
localhostif the database is on the same server as the website)
Update the configuration file
Connect to your website's files using an FTP client or your hosting control panel's File Manager.
Locate the application's configuration file. Common examples include:
WordPress:
wp-config.phpJoomla:
configuration.phpMagento:
app/etc/env.php
Open the file and locate the database configuration section.
Replace the old values with the new credentials provided by Hostek:
DB_NAME (or equivalent): Enter the new database name.
DB_USER (or equivalent): Enter the new database username.
DB_PASSWORD (or equivalent): Enter the new database password.
DB_HOST (or equivalent): Enter the database host (typically
localhost).
Save the changes to the file.
Confirm the result
Once you have updated the configuration file, visit your website's homepage.
The website loads successfully without any database connection errors.
Content, such as blog posts or products, is visible and accessible.
If you see a "Database Connection Error"
If the site fails to load after you have updated the credentials, verify the following:
Check for typos: Ensure there are no extra spaces or missing characters in the database name, username, or password.
Verify the Host: Ensure the database host is correct. If the database is on the same server as the website, it is typically
localhost.Check File Permissions: Ensure the web server has permission to read the updated configuration file.
Limitations
This procedure only updates the application's connection to the database. It does not change the database's internal structure or the data contained within it. If the site still fails to load after a correct configuration update, the issue may be related to a specific plugin or theme conflict caused by the migration.
