Hi, I looked into this again, and it does indeed work. For archival
purposes, here is the test:
* create a forest test-1-forest and a test-1-db, attach them
* create a forest test-2-forest and a test-2-db, attach them
* insert one test document in test-1-db: xdmp:document-insert("test.xml",
<this-is-a-test/>)
* back up db:
xdmp:database-backup(xdmp:database-forests(xdmp:database("test-1-db")),
"/tmp/backups/")
* rename /tmp/backups/20140109-2351133675890/Forests/test-1-forest to
test-2-forest
* restore db:
xdmp:database-restore(xdmp:database-forests(xdmp:database("test-2-db")),
"/tmp/backups/")
* check test document can be found in test-2-db
Finally, no need to delete the Label file, renaming the forest directory is
sufficient.
This works fine on a Mac and ML7 as well as on Windows and ML7. It did not
work when trying to restore a Mac db on a Windows installation of ML7, but
I think I read somewhere that databases are not binary compatible across
operating systems. Final doubt: will it work if the "source" database is
located on one server and is to be restored on another one?
cheers,
Jakob.
On Thu, Jan 9, 2014 at 8:24 PM, Geert Josten <[email protected]> wrote:
> Hi Jakob,
>
>
>
> Deleting the Label should work. MarkLogic is only telling it didn’t find
> one, and will create a new one on the go afaik..
>
>
>
> Not sure why it is complaining in the first place though. Don’t see why a
> forest name should influence the contents of any of the forest files, but
> you never know..
>
>
>
> Cheers,
>
> Geert
>
>
>
> *Van:* [email protected] [mailto:
> [email protected]] *Namens *
> Jakob Fix
> *Verzonden:* donderdag 9 januari 2014 18:05
> *Aan:* MarkLogic Developer Discussion
> *Onderwerp:* Re: [MarkLogic Dev General] strategy for using a database in
> a different application context
>
>
>
> Hi Geert,
>
> size is not currently a problem so we're attempting the backup/restore
> routine.
>
>
> however, we're getting the "Bad forest label magic number" error when we
> are trying to restore a database from a backup from the production server
> to the test server as the database has not the same name (e.g. kv3-prod-db
> vs kv3-nightly-db).
>
>
>
> I found this exchange from last year
> http://markmail.org/thread/3xtlnvrg5izvbdbm where Jim suggests
> successfully, it seems to delete the Label file and to restart the server.
> When we do this ML explains about a missing Label file... maybe this is not
> the same case where this error message is returned.
>
>
>
>
>
>
> cheers,
> Jakob.
>
>
>
> On Thu, Jan 9, 2014 at 5:01 PM, Geert Josten <[email protected]>
> wrote:
>
> Hi Jakob,
>
>
>
> Backup/restore could take relatively long, depending how large your
> database is. Another approaches could be replication. It might also depend
> whether you need a clean database each testrun, because you typically mess
> things up with testing, or not.
>
>
>
> Cheers,
>
> Geert
>
>
>
> *Van:* [email protected] [mailto:
> [email protected]] *Namens *Jakob Fix
> *Verzonden:* donderdag 9 januari 2014 15:14
> *Aan:* General Mark Logic Developer Discussion
> *Onderwerp:* [MarkLogic Dev General] strategy for using a database in a
> different application context
>
>
>
> Hi,
>
>
>
> we'd like to set up a nightly test job that uses the current development
> code base against the latest production database.
>
>
>
> what we were thinking was to do a database backup from the production
> database, and restore it to the test server. is this a logical scenario, or
> is there better?
>
>
> cheers,
> Jakob.
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general