we_dump - dump a WE ObjDB database
we_dump [-version] [-root id | -id id] [-class dbclass] [-lang lang] [-attribs] [-contentattribs] [-[no]lock] [-[no]connect] [-[no]readonly] [-[no]failsafe] [-datadumper] [-o outfile] [rootdir]
we_dump dumps a ObjDB database (only!) to a text file using Data::Dumper. The resulting file may be used to restore a database with the means described in "EXAMPLES".
Show also version objects
Start dump at the given object id (otherwise the whole database is dumped)
Alias for -root id.
Specify WE::DB class e.g. WE_Singlesite::Root
Specify language for titles (default is "en" or the value of the LANG environment variable).
LANG
Show also attributes (very verbose!)
Show also content attributes (page type, languges...)
Lock database (for debugging lock problems)
Create permanent connection to database (for debugging, default is on)
Open readonly connection to database (default is readonly).
Do not open in failsafe mode (default is failsafe)
Do a Data::Dumper dump of the object database.
Only in conjunction with -datadumper: use the specified file for output. Otherwise Data::Dumper output goes to STDOUT.
Use RCS versioning for a Data::Dumper file.
The root directory of the database (default is ., the current directory).
.
A sample crontab entry for making an hourly backup of the object database:
0 * * * * we_dump -datadumper -versioning -outfile /path/to/dumpfile /path/to/we_data
To restore such a dump, the following steps should be done:
Identify the wished dump version by using rlog and co -p -rversion.
rlog
co -p -rversion
Extract this dump version, e.g.
co -p -r1.78 dumpfile > dumpfile-1.78
Recreate the object database. Assuming a common installation using MLDBM, DB_File and Data::Dumper, the following one-liner may be used:
perl -MMLDBM=DB_File,Data::Dumper -MFcntl -e 'tie %db, "MLDBM", "objdb.db", O_RDWR|O_CREAT, 0644 or die $!; $ObjDB = do $ARGV[0]; %db = %$ObjDB' dumpfile-version
Move the created objdb.db to the we_data directory and fix permissions.
Slaven Rezic <eserte@users.sourceforge.net>
To install WE::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WE::DB
CPAN shell
perl -MCPAN -e shell install WE::DB
For more information on module installation, please visit the detailed CPAN module installation guide.