i would like to know if there is any kind of tool to move data from one database to another. In my case i'm trying to move data from hsqldb to mysql.
I've already tried with mysql workbench, but it doesn't support hsqldb.
I think the worst case would be to export data into sql-files, modify these and try to import them in mysql.
Have you tried this.
https://confluence.atlassian.com/conf56/migrating-from-hsqldb-to-mysql-658737210.html
Hope this helps.
There are a few cross-platform tools to move data between different database. These include Flyway. See this page for a list of useful utilities http://hsqldb.org/web/hsqlUsing.html
My solution was SQL-Workbench, which can be used to copy/sync data between databases. You can execute sql-Files in the cli which makes it easy to run remote.
To copy/move/snyc/whatever your data, just use WbCopy.
example:
WbCopy -sourceConnection='username=SA,url=jdbc:hsqldb:/db/myDb'
-targetConnection='username=root,url=jdbc:mysql://someIp:3306/myDB'
-targetTable=SOMETABLE -sourceTable=SOMETABLE -ignoreIdentityColumns=false
-mode=insert,update -keyColumns=ID -deleteTarget=false -continueOnError=false;
Related
I'm using MODx CMS and would like to use git for co-working. However, as you know, MODx stores some of code places in database. So, I'd like to know, how to version MySQL for co-working except dumping? Thanks
You'll need to store the database in some format, and it can't be SQL as you can't just tell a live database to update the schema using a SQL file.
Basically, you'll have to store an incremental set of commands that updates the database. Git won't really help you in this case, you are going to have to use your own system.
The easiest way to achieve this is by just numbering your database versions and storing only the changes in your favorite programming language.
Step 1: store the current database version somewhere.
Step 2: store all updates to the database in files.
update/mysql_1_to_2.py
update/mysql_2_to_3.py
# etc
Step 3: create the initial database
update/mysql_0_to_1.py
If you use that system, all you need to do is keep track of the current in use version and the version that's most recent in your code. When you need to update, just run all mysql_x_to_y scripts and you're done with the versioning. mysql_0_to_1 can do the initial bootstrap and if you somehow manage to ever reach 1000 revisions, just use mysql_0_to_1000 to take a shortcut.
The system I outlined above should work really well for linear repositories, but might be a bit harder to use for trees (branches, multiple developers, etc). I'm sure you can come up with something though.
It sounds like perhaps you are talking about stored procedures and/or user-defined functions?
In any case, the best method is mysqldump - presumably, you don't need the data, just the stored procs, user-defined functions, and perhaps table structures. There are options for mysqldump to control what gets output.
If you want to add versioning of database to versioning of code, you have to see at Liquibase. To avoid repeating everything again, my older full answer on topic
I want to create a cronjob for making a backup (sql dump) from my database and e-mail it to me. Setting up the cronjob and stuff works great and I'm able to use parts of my zend application :)
Unfortunately I cannot use exec() or system() on my server so now I'm looking for a way to get the same result. I searched everywhere with all possible descriptions I could think of, but without any results.
So in short:
I want to backup my databaseup
Preferably in .sql format (like export in phpmyadmin)
Using the Zend framework (so I can use my already loaded
application.ini settings for the database)
I cannot use exec() or system()
I'm completely stuck so really anything would help! Thanks in advance!
The solution by David Walsh looks like what you want:
http://davidwalsh.name/backup-mysql-database-php
A php script that retrieves the tables in a database and saves the data in a .sql file.
Is there a way to use a MYSQL database without the database management system.. Like use tables offline without installing the db management system on the machine..
If there is can you please point me in the right direction?
Thank you!
As far as I know, there is no way to do this.
However, there is a portable DBMS SQLIte. It comes in different ways and can be used on other platform with different programming languages.
After reading your comment, I'm almost sure, this is what you need.
It's not that fast as MySQL I guess, but it works.
You can use The embedded MySQL Server Library to access MySQL data files without running the MySQL server.
You can setup a database to work on your localhost. This will be offline unless you setup the front-end stuff to let the internet interact with it.
What exactly do you mean "without the database management system"? You always need a way of interacting with it, even if it is offline. (Otherwise how can it work for you?)
The server side piece of the application, mysql-server, is needed at a minumum to run mysql. This server application comes with all the tools built-in to manage the instance. I doubt you can prevent installation of this.
If you've actually opened the table files in a hex or text editor, you'll see that you will definitely need the mysql application installed to make any sense of them to use them. Sure the records are all there in plain text (.myd files for myisam, the ibdata1 file for innodb tables), but it would be a complete time-waster devising a custom app to parse or update the file structure, as well as trying to tie in table structure contained in the related files for each table.
I am looking out for a solution to migrate data from Progressdb to MySQL..Please let me know if there are any solutions for the same.Thank you.
If this is a one time thing then the answer above is probably best (dump to ascii and import, or link the tables).
If it is more of a replication oriented problem then you might find http://www.bravepoint.com/products-pro2-replication-suite.shtml to be helpful.
Some possibilities
Export to flat file and import to MySQL
link tables from both databases in Microsoft Access via ODBC, and then xfer data using SQL
What tools are you using to track changes in your MySQL database? Currently I'm in a project where we use a plain text-file (version controlled via SVN) in which we manually add SQL statements when making changes to the database.Many of the changes magically disappears every now and then, and we are now looking for a better way to change track our database.
EDIT:
One thing that I forgot to mention, we are using stored procedures and functions, so it's not only the database structure that we want to track changes on / version controll.
There is a simple solution:
Make all changes to the database schema and static data via scripts
Version control the scripts
Toad for MySQL has a great schema comparison tool
http://www.quest.com/toad-for-mysql/
I think you need something like this (I test it for Firebird and it works very well) :
http://www.upscene.com/products.audit.index.php
I thought there was a MySQL version but NO :(
for MySQL, I see just this :
http://solutions.mysql.com/solutions/partner.php?partner=1532
But if it is just for development, I think that the answer given here is good
mysql-diff compares tables, but not stored procedures yet.