Import and Export

Since version 4.3.3 WPJobBoard has full import and export feature builtin. You can import/export data to CSV and XML. Each of this types has it’s pros and cons and should be used depending on what you are trying to do:

  • CSV – this is the best format if you are planning to process data later in some other software, like Microsoft Excel.
  • XML – this format is best if you are looking to backup your job board data or migrate/copy data to another site.

Full XML Export

Full export you can access from wp-admin / Settings (WPJB) / Import and Export / XML Export it allows to export all your data: custom fields, categories, job types, jobs, applications, companies and resumes. Note that only categories and job types with some jobs or resumes assigned will be exported.

The XML Export panel has a table with data to export and “Start Export” button only.

wpjb-full-export-table

When you click “Start Export“, the button will disappear and progress icon along with some progress info will appear.

wpjb-full-export-progress

When job board will finish exporting data, the progress info will disappear and “Download” button will show. Clicking the button will download zipped archive with exported files.

Partial XML and CSV Export

In WPJobBoard partial export can mean few things, either it is an export of only some data (for example only jobs) or filtered data (for example only applications to job with id = 100).  The partial imports can be accessed from wp-admin / Job Board / Jobs, Applications, Employers and Candidates panels.

On each of this pages you will find “Export …” button below list of items.

wpjb-partial-export-button

Clicking this button will open a new modal window which will allow you to select between XML and CSV export.

Note that this kind of export will export only your current data selection. That is if you are viewing inactive jobs in New York then the export will also contain only inactive jobs in New York.

XML Export

Clicking XML Export link in the modal window will show you page like in the image below

wpjb-partial-xml

Some of the data has “Include Additional Data” which allow to include in the export file some linked data. In case of jobs you can include in the XML companies to which this jobs belong.

Clicking Export To XML will start the export, depending on the amount of data you have it will take anywhere from few seconds to few hours, you will always see total number of items exported and estimated number of items to export.

wpjb-partial-export-progress

When WPJB will finish exporting data you will see a “Download” button.

CSV Export

The CSV Export is a bit more complicated as it allows to select which fields you want to export. Since CSV is not a good format to export long text (like job description) and files, this fields are unchecked by default, but you can check them if you want to.

wpjb-partial-export-csv

Once you select which fields you wish to Export at the bottom of the modal window you will see “Export To CSV” button, clicking it will start export similarly like with XML Export above.

Importing

In order to import data go to wp-admin / Settings (WPJB) / Import and Export panel. From there select either CSV or XML import.

When importing from CSV you need to select data you will be importing, due to how CSV format works in one file you can store only one data type (jobs, companies, resumes or applications).

Other than that both imports are the same, they expect you only to select zipxml or csv file from your computer and start import.

The XML format from which you can import data is described in XML Import API document, but the easiest way to get started is to download the demo data we are using on the demo site and see how the data is structured there.

Customization

Depending on your site, the import / export might need to deal with a lot of data on shared hosting, below are two code snippets that should allow you to tailor the memory and time usage to best fit your server capabilities.

The code below allows to end request and start a new one, once server memory usage will reach certain value, in this case 64MB.

add_filter("wpjb_export_max_memory", "my_wpjb_export_max_memory");
function my_wpjb_export_max_memory($max) {
 return 64;
}

The export can split data into separate files (mainly to avoid opening and appending to huge files which might not work well on shared hostings), the code below will set maximum file size to 20MB.

add_filter("wpjb_export_max_file_size", "my_wpjb_export_max_file_size");
function my_wpjb_export_max_file_size($max) {
 return 20;
}

That’s pretty much it.

  1. Scott
    Reply

    Hi
    Would you explain how to import a csv file in detail?
    How should I make up the csv file to be imported?
    Thanks

  2. wpjobboard@medienfreunde.com
    Reply

    Hi!

    Is there a way to trigger the xml-export from an external/secret url?
    We have another site which wants to import our job listings with all the fields on a regular basis. The rss feed is not detailed enough for this.

    Or is it possible to extend the Wpjb_Module_Api_Xml class to define a special exportAction (similar to rssAction)?

    Thanks!

  3. Tudor
    Reply

    Demo data not available

    • Greg
      Reply

      There was a typo in the link, it should be ok now.

Leave a Reply

Your email address will not be published.