This topic is locked

How to Change Application Database and migrate data

5/31/2025 9:59:14 AM
PHPRunner General questions
C
Chris Whitehead author

I started to build an application in V11 using SQLite, I was having a couple of issues which I'm sure might have been me as I had the DB open in Heidi as well. I then decided to make life easy and build it using MariaDB. Now I want to convert back to SQLite, I'm sure you could do this in v!0.91 as a workaround by creating a template, then using that template to create a new application, that feature isn't available in V11.

Is there an easy method to do this, I'm going to migrate the schema and then update the connection and see if that works.

And before anyone asks why I didn't make it using SQLite in the first place, the easy answer to that is I'm an idiot and you can't teach stupid.

ChatGPT 5/31/2025

No worries! It can be easy to get mixed up with different database systems while developing applications. In PHPRunner V11, there isn't a direct feature to switch databases as easily as in previous versions, but you can still achieve your goal by following these steps:

  1. Export the Schema from MariaDB: If you haven't already, export the schema of your MariaDB database. You can do this by using a database management tool like phpMyAdmin or a command-line utility. Make sure to include all table structures, indexes, and relationships.


  2. Create a New SQLite Database: You can create a new SQLite database using any SQLite management tool or within your application settings in PHPRunner.


  3. Migrate the Schema to SQLite: You will need to manually adapt the exported schema from MariaDB to SQLite. Be aware that there are some differences in SQL dialects between the two databases, so ensure that types and constraints are compatible.


  4. Import Data (if necessary): If you have data in your MariaDB tables that you want to keep, you can export the data from MariaDB and import it into your SQLite database. This can usually be done by exporting to a CSV format and then using SQLite commands to import that data.


  5. Update the Database Connection in PHPRunner: In PHPRunner, go to the "Database" settings and change the connection settings to point to your new SQLite database. Ensure that you select SQLite as the database type.


  6. Test Your Application: After changing the connection, run your application in PHPRunner to see if everything is working correctly. You may need to adjust some settings or code based on the differences between MariaDB and SQLite.


  7. Check for Compatibility Issues: As you test, keep an eye out for any SQL queries or features that might not be compatible with SQLite, as some functions available in MariaDB may not work in SQLite.



By following these steps, you should be able to successfully switch back to SQLite in PHPRunner V11. If you run into any specific issues during the process, feel free to ask for more detailed assistance!

C
Chris Whitehead author 5/31/2025

This new person seems to know their stuff, I'll try exactly what they say and see what happens, wish I'd have thought of that.

Sergey Kornilov admin 6/1/2025

This ChatGPT dude certainly knows a little bit about everything.

C
Chris Whitehead author 6/2/2025

Any idea when we'll be able to export as template?

I do seem to have ran into some new issues using sqlite, but to be fair I can't say if it's this version or the type of database.