WordPress is free and open source content management system written in PHP. It is the easiest and user friendly in terms of open source technologies based on PHP and MySQL framework. It has variety of features such as template library, plug in architecture support and more.
XML files are widely used in WordPress. XML stands for Extensible Mark Up Language and it is the chief part of many different document formats around the world. WordPress may include files of different sizes.
Sometimes it happens that you may want to migrate or port to a new host or server. Then the problem will be backing up the data from WordPress. Your WordPress file may be large in size but WordPress has one limitation. It allows you to back up or import files of only 2 MB in size. So this creates a big problem. It is always said that “Every problem has a solution if you try to solve it”. Here in this case also, the solution is to reduce the size of back up file so that it will be less than 2 MB. We can split the large files into small or tiny sized files to successfully back up the complete file.
WordPress is open source and it is used with different operating systems such as Windows, Linux, MAC OS etc. You can split XML files easily on Windows, Linux or MAC operating system.
Splitting large XML file on Windows operating system
1) You can use a tool called OOXP Splitter or Split That XML which is open source and used to split or break large XML files into different smaller sized files. While splitting the files, this tool also ensures that it maintains and follows the parent and child relationship of the files and XML based validation. You can download it from : http://sourceforge.net/projects/splitthatxml/
You can view a screen shot of this tool below:
It is very easy and simple to use this tool. First you need to run only the Executable (.exe) file. Now you need to Load XML Data File. Then you need to Load XML Schema File. Now you are required to select the maximum and minimum size (in KB) and then select Generate Partition option. You can also try Horizontal Partition if required.
1) Another tool used to split large XML file in Windows is WordPress WXR File Splitter. You can download it from following link:
You just need to download the file and Run it. There is no need to install it. You can view screen shots of this tool below:
Here you need to click on Run button to run the software. Now the WXR File Splitter will open.
As shown in above image, you need to click on Open WXR File to import or upload your large XML file to break into small pieces.
Now you need to click on Split Files to split the large file.
After the file is Split into different files, it will be displayed in the window of our file location as shown below:
Splitting large XML file on MAC operating system
For splitting file in MAC, you need to use a script called “mainSplit” which is written in Python language.
Here you need to go to the Introduction page of your XML file. Now at the page bottom, you need to download the mainSplit.py script.
On download, you need to go to Applications-> Utilities folder and open the terminal and enter the line python mainSplit.py as shown in below image:
Now on running it, WordPress XML Splitter window will open as shown below:
Now in Source, you need to click on Browse file to select the XML file you want to split and in Output Dir, you need to select the folder path where you want the split file to be saved by clicking on Browse Dir.
Now click on the Start and the process of file splitting will start.
Now you can check your split files by going to selected directory as shown below:
Here you can see that large single file is split into multiple small files having size less than 2 MB.
Splitting large XML file on Linux operating system
You can use xml_split command to split or break large XML file into smaller files. This command will split at a given level in tree form that is default, parent and children under them or on a condition.
Each generated file is being replaced by instruction that will allow “xml_merge” to rebuild the document in its original form. The instruction format is: “<?merge subdocs= :<filename> ?>”
The file names will be <file>-<nb>.xml and <file>-00.xml for the main document file.
Author Bio – Nick Grogan is working with Markupbox, which is a specialized PSD to HTML Conversion Company, backed with years of experience and diligent professionals. MarkupBox offers PSD to CSS/HTML, PSD to HTML5 and software implementation services like PSD to Joomla, PSD to Magento, PSD to WordPress, PSD to Drupal and much more.