Adding An SQL Database To My Website

Hello, I hope all is well.

Recently I had to move a website from another server to yours, the problem is I think I only moved over the htdocs file and not the database? As a result the control panel is telling me the site has no SQL Databases?

I have the files, my question is how do I go about uploading the database to your server and linking it to my site?

I won’t leave a link to the site, it just returns a blank white screen with an error message unable to start session, I think the first stage to fixing it is to get an SQL database on the site and see if I can get it open in any way?

Thanks,

5 Likes

I assume the site was using them, as I have the files for them, I just never transferred them over in the FTP process just the HTdocs folder. The site HT docs is already uploaded on the server, I just need to complete the job how do I add the database to the server and link it to the site?

I found this online, would you say this will work and is a good guide? It is just a matter of me getting the database onto the server and attaching it to the database I have all the files, how do I go about it the easiest way? Again it is banging on about editing code and files, which I am very reluctant to do.

To upload an existing SQL database to a Joomla site, follow these steps:

1. Prepare the SQL Database:
Export your existing database as an SQL file using phpMyAdmin or a similar tool. Ensure the export includes all tables and data.

2. Create a New Database:
Log in to your new hosting account’s control panel (e.g., cPanel), navigate to MySQL Databases, and create a new database. Also, create a database user and assign it to the database with full privileges.

3. Import the SQL File:
In the new hosting account’s phpMyAdmin, select the newly created database, click Import, choose your exported SQL file, and click Go to import the data.

4. Upload Joomla Files:
Use FTP or your hosting file manager to upload all Joomla site files (from your local or old server) to the public_html directory (or subdirectory) on the new server.

5. Update configuration.php:
Edit the configuration.php file in the Joomla root directory to match your new environment. Update the following values:

  • $host – usually localhost (or your server’s database host)

  • $user – the database username

  • $password – the database password

  • $db – the new database name

  • $live_site – set to your new site URL (e.g., http://yoursite.com)

6. Verify and Test:
Access your site via the new URL. If you encounter errors, check file permissions (set folders to 755, files to 644) and ensure the database connection details are correct. Use System Information → Directory Permissions in Joomla’s backend to verify settings.

Note: If your existing site is not a Joomla site but uses a different CMS or structure, you may need to migrate content manually or use a migration tool. For Joomla-specific migrations, Akeeba Backup is recommended for a complete site transfer including files and database.

AI-generated answer. Please verify critical facts.

AI is mostly correct

But we use htdocs, not public_html

This is not correct.
All in all you really want to migrate the database, instead of assuming that it has a link.

And database is not some files in your website. Moving the files don’t move the database.

8 Likes

Yes, I gathered that when I created a new site and that has no SQL databases either. I will look into it and see if I can get a exact error message and see what it says. But I do know that all I uploaded via FTP was the HTDocs folder from the subdirectory into the HTDocs on this account.

This is the error I get, on a white screen, both with the Admin link and Homepage

Error: Failed to start application: Failed to start the session

Let me repeat this again to you:

You need to migrate the database. Which up until now you still haven’t done yet. And to migrate the database, you need phpMyAdmin.

You do not upload the database files with FTP.

You need to stop fiddling with FTP, that part is done and now you need to take care of the database.

5 Likes

I have managed to locate the files and aim to have a go this weekend, I had to comment really in case I need help and to keep the thread open.

3 posts were split to a new topic: MySQL vs MongoDB

I am pleased to report that once I focused on what you said and getting that right, I managed to get the site in a condition where I could enable error reporting and identify the syntax error that was stopping my site working. The database has been imported, and now the site is displaying correctly.

Thank you very much to everybody that offered there assistance to me, it is much appreciated.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.