Saturday, July 12, 2008

Transfer data between online/offline database

I have some suggestion to u to do that.I describe the procedure and steps below.If u caught the logic then u can implement it as ur own way..
Step1: The ofline database and Online database table structure should same. It is better to avoid auto increment field in the tables.If you have auto increment field in offline database you should drop the auto increment field from online database.

Step2: First read the last inserted ID and total data for each table and each database(offline and online) and u may write the information in 2 seperate CSV file like offline.csv and online.csv.

Step3: Read and Compare both CSV file.
Step4: If found one table data are not equal in both database then update that online table with new/rest of the row.
Step4.1: To update online database first read the specific table data from offiline database then store them in array then connect to online database and upadate online table with the stored array data.

2 comments:

Anonymous said...

Thanks Abser Vai.

I actually need the mysql connection stream to connect from my local server to remote server thats why I can fetch data from local server and then update my remote mysql database by this data.

Thanks
Hafez Ahmed

Unknown said...

I like this concept. I visited your blog for the first time and just

been your fan. Keep posting as I am gonna come to read it everyday..
Kid

Rock Tickets