1 (edited by Flinkman 2007-07-08 22:43)

Topic: [Solved] Switching from SQLite to MySQL

Hi, I would like to take my web page to another web hosting company, but they don't have SQLite support. Do you know any way how could I convert my heavily modified SQLite forum/page to MySQL? Thanks

Re: [Solved] Switching from SQLite to MySQL

unless you have written some specific sqlite queries it should just be a matter of transferring the data from the sqlite database to the mysql one.

my mind is on a permanent tangent
byUsers forum

Re: [Solved] Switching from SQLite to MySQL

Rich Pedley wrote:

unless you have written some specific sqlite queries it should just be a matter of transferring the data from the sqlite database to the mysql one.

No, but I have no idea how could I do that, I was searching for some software but i didn't find anything.

Re: [Solved] Switching from SQLite to MySQL

It's not so difficult, but yes, it's a bit tricky due to sqlite being typeless. Punbb database schema is the exact same if you use sqlite or mysql, it couldn't be other way anyway.

So, this is what i suggest for unexperienced users:

1. Create a fresh installation of punbb with a mysql database.
2. Using a mysql management tool like pypmyadmin, sqlyog, whatever, generate a SQL file containing the 'create table' statements. Save that file.
3. using a sqlite management tool create a sql file with the insert statements and save it too.
4.create a new empty database on your mysqlserver.
5.Populate your database, use the first sql file to create the tables and the last one to insert the data on them.
6.delete the instalation and database created on point 1

5 (edited by Flinkman 2007-07-07 23:42)

Re: [Solved] Switching from SQLite to MySQL

pedrotuga wrote:

It's not so difficult, but yes, it's a bit tricky due to sqlite being typeless. Punbb database schema is the exact same if you use sqlite or mysql, it couldn't be other way anyway.

So, this is what i suggest for unexperienced users:

1. Create a fresh installation of punbb with a mysql database.
2. Using a mysql management tool like pypmyadmin, sqlyog, whatever, generate a SQL file containing the 'create table' statements. Save that file.
3. using a sqlite management tool create a sql file with the insert statements and save it too.
4.create a new empty database on your mysqlserver.
5.Populate your database, use the first sql file to create the tables and the last one to insert the data on them.
6.delete the instalation and database created on point 1

Well, that sounds damn complicated. I came up with an idea, that I could modify my config.php, and covert the sqlite database to mysql with a program or php script or something. What you think?

Re: [Solved] Switching from SQLite to MySQL

The solution you pointed would work if you were migrating from another DB system than sqlite.

The problem is that SQLITE is typeless am mysql is not.
In a mysql database, every table column has a datatype while in a slite it does not.

This makes it impossible to create a tool that would convert a sqlite database into other 'type' of database. You need to know the database structure.

The procedure i described is not that difficult, if you maintain a forum that's a actually an opportunity to try out stuff and learn a bit.
Otherwise you will have to fix somebody to do that for you.

Re: [Solved] Switching from SQLite to MySQL

I will do what you said, but I would rather copy the create table statements from install.php. I find it easier smile but actually it isn't

Re: [Solved] Switching from SQLite to MySQL

Well, I was able to copy users, PM-s and other stuff but but I had no luck with forums and posts. I recrerated them in mysql but nothing shows up on forum index. sad

Re: [Solved] Switching from SQLite to MySQL

Ok, I made some mistakes, now it's working. Thank you pedrotuga for your help. smile

Re: [Solved] Switching from SQLite to MySQL

Nice to see that it worked well.
It's also nice to have a actual successful migration testimonial.