Recently I needed to download some files from a Wordpress installation where the client only gave me access to the admin dashboard. Fortunately the All-in-One WP Migration plugin was already installed, so I could take a quick backup of the whole site by downloading the installed plugins, theme and database.
To my surprise downloading the backup from the All-in-One WP Migration plugin only gave me a single compressed migration.wpress
file that any unpack tool refused to extract. A little web search brought me to a five year old tool called Wpress-Extractor but the provided binaries for MacOS refused to work because the package was already too old.
So I decided to rewrite this little helpful tool in Node.js to make it cross-platform compatible for Windows, MacOS and Linux.
Ok here it is: A simple 2-step tutorial how to extract a file with the .wpress
extension on your computer:
1. Step
Make sure that you have Node.js installed in your computer:
node --version
# => v14.12.0
2. Step
In your terminal navigate to the location where the .wpress
file is downloaded (e.g. ~/Downloads
) and run the following command:
npx wpress-extract migration.wpress
It then creates a new folder migration/
where the content is extracted into.
That's it for today. If you would like to take a deeper look at this tool, the source code is open source, so feel free to visit the GitHub repository:
Top comments (60)
Really brilliant, Felix. Many thanks for posting this.
Can someone help me understand how to navigate to the location where the .wpress file is downloaded because I don't know how to use node.js
Which operating system (MacOs, Windows, etc.) do you use?
I use Windows
Assuming the
.wpress
file you want to extract is in the "Downloads" folder you should be able to navigate there by running the following command in your CMD/Powershell first:Other options to navigate to the Download folder in CMD/Powershell are shown here: stackoverflow.com/a/57950443/831465
You could also open a CMD session right from the explorer by typing
cmd
right in the address bar of the explorer: howtogeek.com/235101/10-ways-to-op...This will open a new terminal session from the directory that is opened in the explorer and you could start extracting:
After following all your instruction, now it says:
Error: Output dir is not empty. Clear it first or use the --force option to override it.
This happens when a directory exists with the same name as the downloaded file.
e.g. when your file is named
my-backup.wpress
and there is a folder/my-backup
in the same directory the extraction is stopped since it would override the content in the/my-backup
folder on extraction.You could simply rename the
.wpress
file (e.g. frommy-backup.wpress
tomy-backup-1.wpress
) to workaround this.I can't thank you enough. This really helped me. Wish you all the best
Out of curiosity, is there any way to convert a regular file to a .wpress file?
The reverse direction (creating a .wpress file from a directory) is a bit more complicated.
Inside the .wpress file are stored some metadata (e.g. installed plugins, Wordpress version etc.) that are not available in a local file context.
When providing this metadata manually, it would be possible to create a .wpress file.
But this is out of scope for me since I currently have no time to extend the tool further.
Thank you so much! Worked like a charm.
Just like that! I didn't even have to download shit. Thank you!!
I created an account here just to say: thank you. Thank you so very much. Works like a charm.
Haha, nice 👍
Messages like yours always make my day a little brighter, thanks for your support!
I've been struggling trying to extract files from a corrupted backup using the instructions you provided. Is there a video or a more detailed step by step tutorial on how to extract files from a .wpress file? Preferably using terminal
The program itself works sequentially, so when the beginning of the file is correct it extracts the files up to the point when the file becomes corrupted.
While writing the program I used Visual Studio Code to take a look inside the
.wpress
files.It is at least able to show the source code from the files that are packaged inside the archive.
Amazing tool! Exactly what I was looking for when trying to migrate a website to a different server. Currently abroad with very slow internet here. Decided to make a DigitalOcean droplet and use its fast connection to download the 5GB migration file directly to the server with curl.
Then I needed a way to unpack the wpress file and your npx tool came in clutch. Saved me 3+ hrs of download time. Thank you very much!
very helpful, thanks a lot!
Hi Felix, Thank you very much for this tool. I like the way the JavaScript programming was done. If only more npm packages could be simple yet effective like yours.
It runs with the current LTS version of Node.js.
the tool installed nicely, and extracted the .wpress file nicely, but flywheel wont accept the import for some reason: We couldnt figure out what to do with the import file provided. Please extract it manually.; it looks extracted to me though..
Solved my issue where I had a backup from a Multi-Site that I could not import unless I purchased an insanely expensive All-In-One extension. Also couldn't import it into Single site setup or even FTP transfer the 5GB file into the dev server due to size. I literally just needed the image directory. Anyways - THANKS!
For clarity to noobs like me (relatively), I may offer these tips to get it to work on a Mac Terminall:
Good luck!
Hi, can you please show me the steps you take to restore the backup on the new server?
I uploaded the extracted files, overwrite the duplicate files and run the SQL within. So far it looks like nothing happened, the wordpress looks like a new installation.