ServerPress / clean-import

Prepare and clean archives for import into DesktopServer.
2 stars 0 forks source link

Duplicator Pro now also appears to create an archive with the .daf extension. #36

Open GreggFranklin opened 5 years ago

GreggFranklin commented 5 years ago

Bob from Snapcreek(The guys who bought Duplicator) sent us an email contains helpful info and links to code. However these links are no longer valid. I have contacted him for new links and will add them to this thread. Here is the email:

Changes from Duplicator Archives of the Past

1) Slight change in zip: In Duplicator Pro and a yet-to-be-released version of Duplicator Lite, the wp-config.php file is no longer stored as wp-config.php within the zip, instead it has been renamed wp-config-arc.txt. We do this so our installer can safely overwrite an existing site (up until the very last stage of an install we need to know a wp-config.php that already exists in the directory was there from the previous site and not the archive itself. As a final part of our installer, we remove the old wp-config.php and rename wp-config-arc.txt to wp-config.php For your purposes, your logic could simply just look for that file, and if it exists rename it upon import.

Note: Since the current and older versions of Duplicator Lite store wp-config.php as wp-config.php within the archive so ideally both types would be handled for maximum compatibility

2) DupArchive Format: Contents are identical to the zips. We had a lot of problems bundling up large sites using PHP's zip capability so we created our own format, called DupArchive. From, a high level the format looks like:

[Archive Header] [File Header 1] [Glob Header 1.1] ... [Glob Header 1.n] [File Header 2] [Glob Header 2.1] ... [Glob Header 2.n]

Essentially the files within the archive are split up between globs, with all files and globs having headers and various information about those items. You'll be able to see the full details by examining the source code of the extractor.

Files of Interest I have shared the following items in a Google Drive folder (link)

1) Windows DA Extract-Source.zip The attached code is fairly straightforward and should assist in your understanding of this format. Feel free to reuse whatever bits you would like. Note that this code has a bit of special logic in it to handle archives that may have become corrupt, you may not need or want that part.

2) Windows DA-Extract-EXE.zip A zip containing the Windows/.Net extractor executable and its dependencies

3) 20180614_dev_431849c883c5bb094486_20180614164705_archive.daf WordPress site bundled in a DupArchive. Note that you can extract all the files in the .daf using the above extractor then browse to 'installer-backup.php' to have our installer do the actual installation (or you can just check out the files in the dup-installer directory if you want to see PHP source that can handle a .daf)

-- To extract, just put the .daf in the same directory as the exe and run the exe.

Please let me know if you have any questions.

Bob

.daf archive https://www.dropbox.com/s/0ktuf0ifc0dd930/Duplicator%20Pro%20Packages.zip?dl=0

_Originally posted by @GreggFranklin in https://github.com/ServerPress/clean-import/issue_comments#issuecomment-422109691_

GreggFranklin commented 5 years ago

https://drive.google.com/drive/folders/1VqAU5k_n3LwbRWe5o_xVsOhTaSb82HxK?usp=sharing

davejesch commented 3 years ago

Is Duplicator Pro still doing this? Are the fixes in #41 enough that we can close this issue?

If not, please add notes explaining what changes are needed and we'll go from there.