HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

ocPortal Tutorial: Importing data into ocPortal

Written by Chris Graham, ocProducts
Thumbnail: Importing will generally use the contents of database tables designed for one product to create equivalent data suitable for ocPortal

Importing will generally use the contents of database tables designed for one product to create equivalent data suitable for ocPortal

An integrated importer system is provided, which allows merging of content stored in any supported data format into a running site. This merging process allows combination of any number of supported websites, to form a single combined website.


At the time of writing, the following software importers are available:
  • Advanced Electron Forum
  • Invision Board 1.3.x
  • Invision Board 2.0.x
  • MyBB
  • phpBB 2
  • Simple Machine Forum
  • vBulletin 3
  • Wordpress
  • WowBB
And the following special ones:
  • HTML website importer
  • Merge from another copy of the latest version of ocPortal

Memory limits

Importers may use a lot of memory in order to transfer large amounts of data, so you may need to raise the memory limit on your server or import on a different server then copy your site over.
Information on PHP memory limits is included in our FAQ.

Using importers

Thumbnail: A configuration file may be required. This screen-shot illustrates what they are and where they tend to be.

A configuration file may be required. This screen-shot illustrates what they are and where they tend to be.

Thumbnail: The list of importers

The list of importers

At the time of writing, all importers work by interface to the database of the product being imported. In addition, some require the presence of a configuration file for the product at an accessible path on the server, and will auto-detect database settings from this file. It is strongly recommended that you leave your old site installed and running, although perhaps at a moved location, so that the importer can find all the associated files that it may want to import.

The importer system uses a concept of 'import sessions'. These are built on top of the ocPortal login sessions, and are an important feature in allowing you to merge multiple sites into ocPortal: they keep the progress and 'ID remap table' from each import separate. The 'choose your session' interface exists so that if your ocPortal session is lost, you can still resume a previous import.

Thumbnail: Choosing an importer session

Choosing an importer session

Thumbnail: Import options

Import options

Importers define a list of features they can import, along with a dependency system to ensure that a feature can only be imported once any features that it is dependent upon have already been imported (for example, forum posts are always dependent on forum topics, and forum topics are always dependent on forums).

The importer system is designed to be robust, and is programmed as 're-entrant' code; this means that if installation is halted, via failure, timeout, or cancellation, it can continue from where it left off. This is of particular use if there is an incompatibility between your data and the importer, which is not very unlikely due to the wide variation in data for any single product across different versions and usage patterns.

It is recommended that you backup your site files and database before running an importer, in case the importer fails in some way (perhaps an incomplete, or unsatisfactory import, or duplication of data by a poorly written third-party importer).

Thumbnail: After importing some data a success screen is shown. Often special messages will be included on this screen.

After importing some data a success screen is shown. Often special messages will be included on this screen.

Usually an importer will provide information for further actions that must be taken. The following forms of further action are a common requirement:
  • stats recalculation (especially for forum importers)
  • moving of on-disk files from the imported products upload directory, to ocPortal's (this is sometimes done automatically, depending on how the importer was written [which itself depends on the expected data patterns of the imported product]).

ocPortal is designed so that forms of redundancy, such as thumbnails, parsed Comcode, and various forms of tally, can be recalculated dynamically as ocPortal runs. In order to remove load from the importer itself, these are rarely produced by the importer.

Converting to OCF

Thumbnail: ocPortal forum drivers are specially coded PHP files stored in the sources/forum directory (or sources_custom/forum).

ocPortal forum drivers are specially coded PHP files stored in the sources/forum directory (or sources_custom/forum).

Thumbnail: The forum driver can be changed using the base-config editor, but you [b]should not do this[/b] unless you know exactly what you are doing

The forum driver can be changed using the base-config editor, but you [b]should not do this[/b] unless you know exactly what you are doing

If you have been running ocPortal and a third-party forum, and wish to switch to using a complete ocPortal solution (ocPortal with OCF), this is possible if there is a forum importer for your current forum product. The opportunity is presented to move to OCF as the last importable feature of a forum import, and the function will 'jump' forum drivers for you and re-map any usergroup and user IDs. It is still strongly advised to check your permissions after performing this.

Important note: If you have installed ocPortal, and interfaced to a third-party forum, but want to switch to OCF without an import (because your forum is essentially empty still), then it is possible but we would discourage it for anyone other than an expert user. To do this you need to use the config editor to 'jump forum driver', but you also need to reset all your permissions for the new forum drivers usergroups, which quite possibly leaves a window of vulnerability if privileges are present which should not be. In addition, any ocPortal systems that reference users will reference different users after switching, as user-IDs will have changed: for example, point transactions and admin logs will reference the wrong users.

Switching forums, without converting to OCF via an importer

ocProducts does not in any way support moving between different forum vendors/databases, after ocPortal has been installed. This is due to the member and usergroup IDs ocPortal uses being tied to the member and usergroup IDs of the linked forum. Because the actual usergroup and member data is not held or managed by ocPortal, ocPortal is entirely sensitive to changes to this data, yet has no way of properly detecting or synching against changes made to it.
All this said, it is possible to move between forums, if manual database changes are made to correct the aforementioned problems.

Specifics of importers

ocPortal merge

When merging with another copy of ocPortal, you should make sure the other copy must be running the same major version. Whilst other versions may merge successfully, ocProducts does not support this officially.

The 'ocp merge' importer can merge multiple ocPortal websites together that either:
  • each run on OCF (and thus, OCF data gets merged)
  • or, each share a forum database (what we call a "multi-site-network" situation)
The importer only handles ocPortal (including OCF) data.

The 'ocp merge' importer cannot:
  • Work with anything other than ocPortal data (third-party forum data can not be merged, for instance)
  • Merge an ocPortal site into an ocPortal site that does not use the same forum database
    • unless you are highly technically proficient and capable of manually changing member and usergroup IDs, using a tool such as phpMyAdmin (because these IDs could not be mapped correctly for data that used a 'foreign' forum)
    • or unless both sites run on OCF (because in this situation, the importer can import everything, and correctly remap any member and usergroup IDs)
  • Import OCF data directly into a third-party forum
    • because the imported data would end up in the OCF database tables, regardless of whether they are currently being used for the ocPortal site's active forum.

  • you must specify to import from an ocPortal database, not a forum database.

Other limitations:
  • The importer does not cover Comcode pages fully, only their meta data. However these are just .txt files (<zone>/pages/comcode_custom/<language>/<page>.txt) that may be copied from one install to another.
  • Shopping orders aren't imported, make sure there are no outstanding orders at the point of importing.
  • Due to a complex cylic-dependency, usergroup custom fields won't import
  • Comcode ownership is not imported if multi-lang-content is on

Please note that URL and page-link links will not be altered during the import, meaning it is likely they will need updating (because resource IDs change).

Discussion Forum importing

Compatibility notes in general:
  • personal/private message will be glued together to form Private Topics. This is a very useful feature, and really cleans up an inbox.


Compatibility notes:
  • phpBB does not support attachments by default, but there is an attachment importer. Only use this if you have the popular attachments mod installed and running. Attachments are moved to the ocPortal attachment upload directory.
  • phpBB uses a very strange usergroup configuration, so it is necessary to check your usergroups, permissions and usergroup membership after import. Forum permissions will not import properly.


Compatibility notes:
  • the vBulletin calendar recurrence system is very different to the ocPortal calendar recurrence system, so recurrences may not be imported perfectly
  • forms of rating, such as topic rating, karma, and 'goes to coventry', are not imported. However reputation is imported as points.
  • Many vBulletin will not be imported
  • attachments, photos and avatars are extracted from the database to the appropriate ocPortal uploads directory. It is best to use the live database for the import, because there is a mySQL/vBulletin bug in some mySQL versions that causes binary database data to be corrupted in SQL dumps.

Invision Board

Compatibility notes:
  • Many Invision Board options will not be imported
  • attachments, photos and avatars are moved to the appropriate ocPortal upload directory

HTML website importer

The HTML website importer is a special importer that can import an HTML site that is stored on disk. It is designed for migrating existing static HTML websites into ocPortal.
The importer will try and establish what your GLOBAL_HTML_WRAP template should be, but it cannot be perfect at this. It is also not able to extract panels or menus in a particularly clever way (they all go as static markup in the aforementioned template files), so you should consider your imported site as a base that will require some cleaning.

If you do not have access to the files of your site, other than from the live server, you can download a website using the 'wget' tool. This tool exists on most Linux installs by default, but can also be installed for Mac and Windows.
You run wget using a command like:


wget -nc -r <yoururl>
and your files from the URL's domain will neatly be saved in a directory underneath the command prompts current working directory named after the domain name. wget works by spidering/crawling your website for files, so it can only download what it finds by following the links that exist on it. Note that it also is not able to find files referenced by your CSS (e.g. background images).

The HTML website importer will try to do the following:
  • Create zones
  • Create Comcode pages
  • Copy over PHP files as pages (mini-modules)
  • Create the GLOBAL_HTML_WRAP template
  • Try and fix links and file paths to be workable ocPortal links
  • Copy over other files that are referenced (such as image files), to underneath uploads/website_specific, and fix the URLs accordingly
  • Work out your website name
  • Meta keywords and description, for each page
When you run the importer you will only get an option to import 'Comcode pages'; all the above things are subsumed within that.

The importer uses a sophisticated algorithm to detect what your header and footer is. It isn't 100% perfect however (it is very CPU intensive, and may lock onto markup similarities between comparison pages that should not be universal). If you have a header.txt and/or footer.txt file in your source directory, the importer will consider these the header/footer instead, an use them when it comes to stripping down the pages.

After importing

If the importer you used copied all relevant files, like avatars, photos and attachments, into ocPortal's directories, then you can remove the imported product directory in whole.
However, it is advisable to keep the directory, database, and import session, around for a few weeks – just in case any data was not correctly imported and extra maintenance required to put things right: importing is a technically complex process, so it is always best to keep your doors open.

Getting a new importer written for you

ocProducts is always happy to hear from you if you have a website running a moderately-to-highly popular product, and you would like to switch to running our software. This is not just for the obvious reason of increasing our user-base, but also presents us an opportunity: to write and test an importer to a working website. Programming an importer to a database is relatively easy for us, but getting access to test data is not. Please contact us and we may be able to arrange a reduced-cost conversion!

Additional help

As importing does not always go to plan, ocProducts is available for support. If you run a website that you are able to justify temporarily hiring us, you may wish to contact us before import, so that we can be prepared to assist, or perform the whole process ourselves.

Writing a new importer

For developers instructions on writing an importer please see the ocPortal Code Book.

See also