Re: Transferring data
Re: Transferring data
- Subject: Re: Transferring data
- From: Kieran Kelleher <email@hidden>
- Date: Fri, 21 Apr 2006 11:31:32 -0400
You could also use a SQL dump and a SQL import. For convenience throw
the two commands into a bash script.
For example, I regularly want to replace my dev data with the live
data in the live database server so I can test my app with "real
world" data/conditions and I use a simple bash script as shown here.
I use MySQL, but surely there are similar tools for other database
vendors...
<snip>
#!/bin/bash
cd /tmp
mysqldump -h dbserverhostname --opt --databases databasename >
databasename-live-with-data.sql
mysql -h localhost < databasename-live-with-data.sql
echo "Done."
</snip>
I am guessing that this is much faster than javaeoutil and this works
fine with big databases.
HTH,
Kieran
On Apr 21, 2006, at 10:28 AM, Paul Suh wrote:
Randy,
What you're thinking of is the old eoutil tool. It's still there,
just hidden a bit and turned into a Java application. Open a
terminal window and execute /System/Library/WebObjects/
JavaApplications/javaeoutil.woa/javaeoutil -- at first it will look
like a typical WO app is launching, then it will print out usage
information. For moving data in and out of databases, the typical
usage is two steps -- one to dump the data out to a plist file, one
to read the plist into a new DB. The nice thing is that as long as
the EOModels are set up correctly, this is a great way to move
small amounts of data between databases. (The tool is limited by
RAM, as it essentially reads in the entire database and turns it
into raw rows before pumping it out.)
Typical usage is:
./javaeoutil dump /path/to/mymodel1.eomodeld -source database -dest
plist /path/to/outputfile.plist
./javaeoutil dump /path/to/mymodel2.eomodeld -source plist /path/to/
outputfile.plist -dest database
Your database connection information will be specified in the two
EOModel files. Hope this helps.
--Paul
Paul Suh
http://www.ps-enable.com/
email@hidden (301) 643-1516
On Apr 20, 2006, at 11:35 AM, webobjects-dev-
email@hidden wrote:
Date: Wed, 19 Apr 2006 15:47:19 -0400
From: "Randy Wigginton" <email@hidden>
Subject: Transferring data
To: "'WebObjects-List Apple'" <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"
A few years ago with WO 4.5, there was a utility that would
download all
tables referenced by an EOModel and save a text file. Then you
could modify
the db info on the model, and upload it to a different Database.
Is there
any such utility available/working these days?
I don't have a lot of data to move... but I'm hoping it can be easy.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden