How to Find & Configure Subdomain Files in (Hostinger) hPanel (After Server Migration)
If you’ve migrated your website in/to hPanel (Hostinger) and can’t access or update your subdomain (e.g., en.example.com), this guide explains where the files live and how to fix database credentials.
The Problem
After migrating, you:
- Get errors like “Error establishing a database connection” (or “Page not found” when want to access your subdomain website.
Why This Happens
When you create a subdomain via hPanel:
- Hostinger automatically creates a new folder inside your main site’s public_html directory.
- The folder name matches your subdomain (e.g., public_html/en/ for en.tennis-lesson.org).
- All subdomain files (including wp-config.php, .env, or custom scripts) are stored here.
- The subdomain does not use the main site’s database credentials by default.
Step‑by‑Step Solution
Step 1: Log into hPanel
- Go to Hostinger’s dashboard and log in with your credentials.
Step 2: Access Your Website’s Dashboard
- On the left‑hand menu, click Websites → Website list.
- Find the main domain hosting your subdomain (e.g., workfromhomejobs.org).
- Click the Dashboard button for that website.
Step 3: Create the Subdomain
- In the website dashboard, go to the left menu → Domains → Subdomains.
- Click Create Subdomain.
- Fill in the details:
- Subdomain: Enter the prefix (e.g., en for en.workfromhomejobs.org)..
- Click Create.- Document Root: hPanel will auto‑fill: /home/u719043763/domains/workfromhomejobs.org/public_html/en).
Step 4: Verify Subdomain Settings
- After creation, you’ll see the subdomain listed with:
- Full subdomain name: (en.workfromhomejobs.org)
- Directory: /home/u719043763/domains/workfromhomejobs.org/public_html/en
- Confirm the directory path matches your expected file location.
Step 5: Create a New MySQL Database And Database User
- Return to the Website list (left menu: Websites → Website list).
- Click the Dashboard button for your subdomain. After that, you will see the name of main domain, but do not worry and continue.
- Enter a database name and database user (e.g., work_en_db). The names must be different from the main domain database name and password in your choise.
- Click Create → Note the full database name, user name and password (e.g., u719043763_work_en_db).
You now have the 3 critical parameters:
- Database Name: u719043763_work_en_db
- Username: work_en_user
- Password: [your secure password]
Step 6: Configure Files
- Go to File Manager in the website dashboard.
- Navigate to:
- /home/u719043763/domains/workfromhomejobs.org/public_html/en
- Locate your config file:
- WordPress: wp-config.php
- Other CMS: .env, config/database.php, etc.
- Edit the config file to update database credentials:
- // For WordPress (wp-config.php)
- define(‘DB_NAME’, ‘u719043763_work_en_db’);
- define(‘DB_USER’, ‘work_en_user’);
- define(‘DB_PASSWORD’, ‘your_secure_password’).
Tip: Double‑check for typos in the database name, user, and password.
Step 7: Access phpMyAdmin
- Go to the subdomain Databases section and click on phpMyAdmin. This opens the database management interface.
- Import your database sql file
Step 8: Test the Subdomain
- Clear your browser cache or use a private window.
- Visit http://en.workfromhomejobs.org.
- If errors occur:
- Confirm the config file is in public_html/en/.
- Verify database credentials match hPanel’s MySQL section.
- Check DNS propagation (wait 1–24 hours if needed).
Summary
- Create subdomain in hPanel → auto‑generates folder.
- Create database + user → save credentials.
- Upload database files to the new database in phpMyAdmin.
- Go to subdomain folder public_html/en/.
- Update config file with new database details.
- Test subdomain after clearing cache.
By following these steps, you ensure your subdomain is fully functional on the new server.



