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.

Top comments (64)

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

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

Collapse
 
erionbrace profile image
erionbrace

I use Windows

Thread Thread
 
ofhouse profile image
Felix Haus

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

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

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

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
 
deborahtrez profile image
Aanyu Deborah Oduman

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

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

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 • Edited

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
 
volverainc profile image
volverainc

very helpful, thanks a lot!

Collapse
 
ardelisinbaking profile image
ardelisinbaking • Edited

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..

Collapse
 
evoratec profile image
Juan Antonio Navarro

Great tool. Thank you very much.

Collapse
 
ofhouse profile image
Felix Haus

You are welcome, thanks for the feedback 😊

Collapse
 
vaclav_keil profile image
Václav Keil

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.

Collapse
 
arnoldflexy profile image
ArnoldFlexy

Thank you so much, it worked!!!

Collapse
 
ofhouse profile image
Felix Haus

Great to hear, happy to help 😊