Skip to content

How to import Ads from other classifieds website?

If you have old classifieds website and want to move your ads to Classibase powered website then we have feature for importing ads using XML file format. Ad importing with XML will import ads and create all necessary categories, locations, custom fields if they are not already created. Before importing ads try it on test server first and check if any custom fields, categories, locations messed up. If everything worked as you expected then repeat process on live site.

Import Classified ads

Before starting to import ads:

  • Make sure that you have access to source server’s database
  • Please try importing ads on test site. If everything goes ok then repeat process on live site.
  • Backup your sites images located in /user-content/uploads/adpics/
  • Backup your database using tools provided by your hosting server
  • Ad importing will import all ads read from XML, if you want to load only some categories then code your XML generation files accordingly.

To start importing follow these steps:

  1. Navigate to “Tools”->”Import data” on admin panel
  2. At the bottom in “Import ads” area put URL for xml file. XML file should be formatted like displayed in example above URL field. XML generation explained below.
  3. Click “Import” button. After import starts log consisting of actions performed will be displayed below button.

How-to-import-Ads-from-other-classifieds-script

There are cases when ad will not be imported:

  • If user email is not valid ad will not be imported
  • If ad description already exists in classibase database then ad will not be imported

How to generate XML file for old classifieds website ads?

Xml file should be formatted like displayed on “Tools”->”Import data” page. We wrote example PHP file that generates import XML file for zxero classifieds script.

Here are instructions how to use export XML file (source server: server from which you want to copy ads; destination server: server where you want to copy ads, it is where classibase script runs.):

  1. Download PHP files for generating XML. These files will work only with xzero classifieds script. To make it work with other classifieds script you have to completely change export_xml_xzero.php file to fit your source database structure.
  2. Extract files to your computer.
  3. Edit export_xml_xzero.php file. Define following variables with your source server values: DB_NAME, DB_HOST, DB_USERNAME, DB_PASSWORD, IMAGE_URL_PREFIX for your old site.
  4. Upload extracted files to your source server.
  5. Test xml file by navigating http://yoursite.com/export_xml_xzero.php address from your browser.
  6. Then navigate to http://yoursite.com/export_xml_xzero.php?page=2 address from your browser. This is second page with next 10 ads. Classibase will import ads by 10 until all ads imported. This is done to prevent server overloads.
  7. If xml renders correctly then you are ready to import ads from source server.

XML file format

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
	<title>SCRIPT_NAME export</title>
	<description>export of existing system data</description>
	<item>
		<title>Ad title here</title>
		<link/>
		<description>Ad description here</description>
		<pubDate>Tue, 1 May 2018 16:50:31 +0000</pubDate>
		<verified>1</verified>
		<enabled>1</enabled>
		<phone>123465</phone>
		<email>[email protected]</email>
		<showemail>show</showemail>
		<ip>127.0.0.1</ip>
		<location>
			<val>State name</val>
			<val>City name</val>
		</location>
		<category>
			<val>Category name</val>
			<val>Subcategory name</val>
			<val>Sub sub name</val>
		</category>
		<image>http://localhost/export_xml_static/img1.jpg</image>
		<image>http://localhost/export_xml_static/img2.jpg</image>
		<image>http://localhost/export_xml_static/img3.gif</image>
		<image>http://localhost/export_xml_static/img4.gif</image>
		<customfield>
			<name>Address</name>
			<value>Great str. 123/8</value>
			<type>address</type>
			<defined></defined>
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Checkbox name</name>
			<value>
				<val>Checkbox 1</val>
				<val>Checkbox 5</val>
			</value>
			<type>checkbox</type>
			<defined>
				<val>Checkbox 1</val>
				<val>Checkbox 2</val>
				<val>Checkbox 3</val>
				<val>Checkbox 4</val>
				<val>Checkbox 5</val>
				<val>Checkbox 6</val>
			</defined>
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Dropdown name</name>
			<value>Dropdown 1</value>
			<type>dropdown</type>
			<defined>
				<val>Dropdown 1</val>
			</defined>          
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Radio name</name>
			<value>Radio 1</value>
			<type>radio</type>
			<defined>
				<val>Radio 1</val>
			</defined>          
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Number name</name>
			<value>5</value>
			<type>number</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Price name</name>
			<value>15</value>
			<type>price</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Text name</name>
			<value>Sample text here</value>
			<type>text</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>URL name</name>
			<value>https://google.com</value>
			<type>url</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>      
	</item>	
	<item>
		<title>Ad title here 2</title>
		<link/>
		<description>Ad description here 2</description>
		<pubDate>Tue, 1 May 2018 16:50:31 +0000</pubDate>
		<verified>1</verified>
		<enabled>1</enabled>
		<phone>123465</phone>
		<email>[email protected]</email>
		<showemail>show</showemail>
		<ip>127.0.0.1</ip>
		<location>
			<val>State name</val>
			<val>City name</val>
		</location>
		<category>
			<val>Category name</val>
			<val>Subcategory name</val>
			<val>Sub sub name</val>
		</category>
		<image>http://localhost/export_xml_static/img3.gif</image>
		<image>http://localhost/export_xml_static/img4.gif</image>
		<customfield>
			<name>Address</name>
			<value>Great str. 123/8</value>
			<type>address</type>
			<defined></defined>
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Checkbox name</name>
			<value>
				<val>Checkbox 1</val>
				<val>Checkbox 2</val>
				<val>Checkbox 3</val>
			</value>
			<type>checkbox</type>
			<defined>
				<val>Checkbox 1</val>
				<val>Checkbox 2</val>
				<val>Checkbox 3</val>
				<val>Checkbox 4</val>
				<val>Checkbox 5</val>
				<val>Checkbox 6</val>
			</defined>
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Dropdown name</name>
			<value>Dropdown 8</value>
			<type>dropdown</type>
			<defined>
				<val>Dropdown 8</val>
			</defined>          
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Radio name</name>
			<value>Radio 3</value>
			<type>radio</type>
			<defined>
				<val>Radio 3</val>
			</defined>          
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Number name</name>
			<value>5</value>
			<type>number</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Price name</name>
			<value>15</value>
			<type>price</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>Text name</name>
			<value>Sample text here</value>
			<type>text</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>
		<customfield>
			<name>URL name</name>
			<value>https://google.com</value>
			<type>url</type>
			<defined></defined>         
			<is_search>0</is_search>
			<is_list>0</is_list>
		</customfield>      
	</item>	
	<!-- ... other items below. keep it at most 10 records. per page. paginate adding ?page=2 after url -->
	</channel>
</rss>

You can see in above example some fields are directly stored in ad, others stores as custom field.  XML structure is similar to database of classibase.

Fields stored in ad table:

  • title
  • description
  • pubDate
  • phone
  • email

There is no price, address or url fields stored in ad. Those fields are stored in custom fields.

Data stored as custom fields with following types:

  • number
  • price
  • text
  • video_url
  • address
  • url
  • email
  • checkbox - should have value->val nodes and same fields as defined->val node
  • radio - should have value node and same value in defined->val node
  • dropdown - same as radio should have value node and same value in defined->val node

On custom fields other than checkbox, radio and dropdown defined node will be ignored.

Images - should be absolute publicly accessible url.

Example xml files for importing

Remember to configure these files before using.

  • export_xml_xzero.zip - XML from xzero script database. Generates xml file connecting to database. Configure php file after downloading, add server details.
  • export_xml_csv.zip  -  XML from CSV file. Converts example .csv file to xml format for inserting to classibase. Adjust php file to match your csv file.
  • export_xml_static.zip - Static XML file. Example for importing an ad with checkbox, dropdown, radio, address, number, price custom fields and images. This is same code displayed in above code snippet.

Update 28.03.2014: URL structure and permalinks will not be transferred when you import ads from your old website. If you migrated from old website to new one  and kept same domain name then traffic that will come using old URLs will see "404 page not found" page.

Recovery time after moving to ClassiBase

Following image of website visitor statistics show that traffic recovered in 5 month and tripled after a year when classifieds website switched from other old script to ClassiBase. Result may vary depending on your old website SEO optimization level.

Classifieds website traffic after switching to ClassiBase increased 3 fold in a year

Classifieds website traffic after switching to ClassiBase increased 3 fold in a year