DEV Community

Cover image for How to unpack .wpress archive files created by the All-in-one-Wp-Migration Wordpress plugin
Felix Haus
Felix Haus

Posted on

How to unpack .wpress archive files created by the All-in-one-Wp-Migration Wordpress plugin

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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:

GitHub logo ofhouse / wpress-extract

A simple Node.js tool for extracting wpress archive files generated by the All-in-one-Wp-Migration Wordpress plugin.

Discussion (32)

Collapse
goatcloud profile image
Cliff Rohde

Really brilliant, Felix. Many thanks for posting this.

Collapse
blmurch profile image
blmurch

Thank you so much! Worked like a charm.

Collapse
erionbrace profile image
erionbrace

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

Collapse
ofhouse profile image
Felix Haus Author

Which operating system (MacOs, Windows, etc.) do you use?

Collapse
erionbrace profile image
erionbrace

I use Windows

Thread Thread
ofhouse profile image
Felix Haus Author

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:

cd "$HOME\Downloads"
npx wpress-extract <downloaded-file.wpress>
Enter fullscreen mode Exit fullscreen mode

Other options to navigate to the Download folder in CMD/Powershell are shown here: stackoverflow.com/a/57950443/831465

Thread Thread
ofhouse profile image
Felix Haus Author

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:

npx wpress-extract <downloaded-file.wpress>
Enter fullscreen mode Exit fullscreen mode
Thread Thread
erionbrace profile image
erionbrace

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.

Thread Thread
ofhouse profile image
Felix Haus Author

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. from my-backup.wpress to my-backup-1.wpress) to workaround this.

Thread Thread
erionbrace profile image
erionbrace

I can't thank you enough. This really helped me. Wish you all the best

Thread Thread
erionbrace profile image
erionbrace

Out of curiosity, is there any way to convert a regular file to a .wpress file?

Thread Thread
ofhouse profile image
Felix Haus Author

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.

Collapse
jakeadriano profile image
Jake Adriano

I created an account here just to say: thank you. Thank you so very much. Works like a charm.

Collapse
ofhouse profile image
Felix Haus Author

Haha, nice ๐Ÿ‘
Messages like yours always make my day a little brighter, thanks for your support!

Collapse
tko profile image
TKO

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

Thread Thread
ofhouse profile image
Felix Haus Author • Edited on

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.

Collapse
deborahtrez profile image
Aanyu Deborah Oduman

Just like that! I didn't even have to download shit. Thank you!!

Collapse
brams_s profile image
Brams

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!

Collapse
arnoldflexy profile image
ArnoldFlexy

Thank you so much, it worked!!!

Collapse
ofhouse profile image
Felix Haus Author

Great to hear, happy to help ๐Ÿ˜Š

Collapse
evoratec profile image
Juan Antonio Navarro

Great tool. Thank you very much.

Collapse
ofhouse profile image
Felix Haus Author

You are welcome, thanks for the feedback ๐Ÿ˜Š

Collapse
deborahtrez profile image
Aanyu Deborah Oduman

Could you be knowing how to deploy the extracted site to GitHub with gh-pages?

Collapse
ofhouse profile image
Felix Haus Author

Not sure if I understand your question correctly.
Since Wordpress requires a PHP runtime which gh-pages does not provide, uploading .php files would only result in people seeing the source code when visiting the GitHub page.

Collapse
tko profile image
TKO

Is there a video that demonstrates how to unpack .wpress archive files using a Mac?

Collapse
ofhouse profile image
Felix Haus Author

No, since the process and used commands are the same whether you are using a Mac, Linux or Windows machine.

Thought about making a video from it, but then discarded the idea since it would only show me how I would badly type in the command from the post in my terminal ๐Ÿ˜…

Collapse
ste6412 profile image
Stephen Hamill

Worked like a charm! Thank you for this

Collapse
ofhouse profile image
Felix Haus Author

You're welcome! I'm amazed how many people already used it ๐Ÿ˜€

Collapse
clarinogueira profile image
Clari Nogueira

Hi. Can someone help me navigate to the location because I keep getting the "permission denied" and "command not found". I use Mac M1 and the .wpress file is in users/mc/downloads... Thank you!

Collapse
brams_s profile image
Brams • Edited on

Hey, I was also getting a permission denied warning when using this on a 20.04 ubuntu droplet on Digital Ocean.

I moved it to another directory where I had more rights and it worked like a charm. Seems to be related to your write permissions for the folder were your migration.wpress file is trying to unpack

Collapse
callworthp profile image
callworthp

THANK YOU! This worked awesome and saved me a lot of pain.

Collapse
mrrich50 profile image
MrRich50

Thanks Felix! Works like a champ.