Page 1 of 1

Uploading sql database to site

PostPosted: 23. August 2011 18:24
by zacaj
Ive been developing a mysql based website on my computer using XAMPP, and now Ive moved the code to my server. I can move the database over by deleting the current database on the server, and then importing it using phpmyadmin, but I was hoping to be able to always write posts and edit the site locally, and easily update the server when im happy with the changes, which would also help with backup, etc. But I cant find any way simpler than deleting the tables and reimporting them every time

Re: Uploading sql database to site

PostPosted: 23. August 2011 19:02
by Altrea
That deeply depends on the application.
You are the developer, so you know the changes between two versions.
Write an upgrade script which brings the database up to date.

Re: Uploading sql database to site

PostPosted: 23. August 2011 19:25
by zacaj
Theres no automated way to do this?

Re: Uploading sql database to site

PostPosted: 23. August 2011 19:33
by JonB
Theres no automated way to do this?


You wrote the code as I understand it. So if there is an automated way to do it, then it would be in your code, right???

How is a database engine supposed to know when it suits your purpose to update a remote database?? :shock:

Good Luck
8)



ucf

Re: Uploading sql database to site

PostPosted: 23. August 2011 19:55
by zacaj
I mean like, some program/script that takes the ip+login for the two dbs, and goes through them looking for changes, and edits the second when it finds them.

Re: Uploading sql database to site

PostPosted: 23. August 2011 21:25
by JonB
I mean like, some program/script that takes the ip+login for the two dbs, and goes through them looking for changes, and edits the second when it finds them.


Yep that is exactly what is needed - and you are in charge - it has no way to know what databases, tables and columns to iterate. There are likely many fields you don't want updated from server to server (metadata).

(which is exactly what Altrea told you in the first place)

THERE IS such a thing as slaves and mirrors, but they are meant to be unconditional replicants. they are for redundancy/failover by design, not selective updating.'

Google this - "MySQL slaves mirrors"

Good Luck
8)

Re: Uploading sql database to site

PostPosted: 23. August 2011 21:31
by Altrea
Another try for googling is for "mysql sync software".
There are some solutions, but i don't know a market-leading program for that.

I would use MySQL Workbench for this, if i would ever need it.

Re: Uploading sql database to site

PostPosted: 23. August 2011 21:57
by zacaj
It can just be a direct copy, there is no differences between the two databases. Ill look into those