From: Leiss, Klaus-G. 3. S-IS-RD-E. <Kla...@he...> - 2003-11-19 10:16:52
|
Hello Frank, I saved your message to the list, here are the parts that you wrote. > From: Frank Shearar [mailto:fra...@rn...] > Sent: Wednesday, July 09, 2003 5:36 PM > To: php...@li... > Subject: RE: [Phpwiki-talk] Restoring a ZipDump backup <snip> =20 > Well, I hacked something together by chopping in lib/loadsave.php and > lib/WikIDB.php. >=20 > In summary, I commented out most of SavePage (all the bits=20 > with checking to > see if we want to merge or overwrite pages) and just save the=20 > revisions as > they come out the RFC822 files. Then in WikiWD.php I cut out=20 > the sanity > checking of revision numbers and overwrite existing=20 > revisions. This is, of > course, directly counter to the philosophy that old revisions=20 > are read only, > but this was a temporary hack and I wanted to exactly restore a wiki. >=20 > In detail, here are the diffs: (foo.restore is my special=20 > hacked version of > foo.php, of course) >=20 > -bash-2.05b$ diff loadsave.php loadsave.php.restore > 376a377,380 > > echo $pageinfo['pagename'] . ', ' . $pageinfo['version']; > > $page =3D $dbi->getPage($pagename); > > $page->save($content, $pageinfo['version'], $versiondata); > > /* > 483a488 > > */ >=20 > -bash-2.05b$ diff WikiDB.php WikiDB.php.restore > 21a22 > > define('WIKIDB_RESTORE', 1); > 615,621c616,628 > < $latestversion =3D $backend->get_latest_version($pagename); > < $newversion =3D $latestversion + 1; > < assert($newversion >=3D 1); > < > < if ($version !=3D WIKIDB_FORCE_CREATE && $version !=3D = $newversion) { > < $backend->unlock(); > < return false; > --- > > if (WIKIDB_RESTORE) { > > $latestversion =3D 0; > > $newversion =3D $version; > > } else { > > > > $latestversion =3D = $backend->get_latest_version($pagename); > > $newversion =3D $latestversion + 1; > > assert($newversion >=3D 1); > > > > if ($version !=3D WIKIDB_FORCE_CREATE && $version !=3D = $newversion) { > > $backend->unlock(); > > return false; > > } >=20 > Then for each wiki I first created an IdontExist page, made=20 > its content > "<?plugin WikiForm action=3Dloadfile?>", logged in as admin &=20 > hit the button. >=20 > It seemed to work OK, although I'm still checking out the=20 > nitty gritties & > corners of my wikis. >=20 > frank |