Jump to content

Legacy or second database with Processwire

Jim Bailie

Recommended Posts


So we're wrapping up an internal application using PW. We have about 6500+ pages in so far and 14 fields. It's a pretty vanilla setup. We've got a lot of positive feedback, etc.

Now this app is getting a little more notice than we previously thought and there's interest in merging another application with it.

This legacy application has a well established database that will serve the new PW pages very well, but I couldn't, in good conscience, try to convert it to the "Processwire Way".

So I'm curious to hear any stories or anecdotes about how others may have legacy DB's working with new PW apps. Are you using two or more db's? Have you folded existing tables into the PW db?

I hope this question isn't too nebulous.

Link to comment
Share on other sites

19 minutes ago, Jim Bailie said:

So I'm curious to hear any stories or anecdotes about how others may have legacy DB's working with new PW apps. Are you using two or more db's? Have you folded existing tables into the PW db?

I've done both so far. Since we use PW for our corporate intranet, there are a number of additional databases we pull data from, which is quite straight forward (just an include that instantiates a new WireDatabasePDO and wire()s it). We have a search interface to our test report database where all the data for on-site test runs of our machines are stored, pull in infos about the processing state of lab samples and display an ajax loading tree of standard parts lists for the project engineers from the ERP. Other DBs have been converted to PW pages, like e.g. the archive for the old support ticket system. We even have a mix at some places. For our sales department, we pull the contact information for our worldwide offices from the ERP, create pages if they don't exist yet, and the department augments these pages with additional infos like contractual details that the ERP can't store without climbing through major hoops. We have a semi-live attendance list (the most visitied page by far) filled with data combined from PW's user list (synchronized from Active Directory), attendance status from the time accounting software and person info like the building/room number from the ERP, with the HTML output being generated every five minutes by a background job to ease server load a bit. We have some additional, non-PW tables in the PW database for speeding up things, like caching the listings of large directories with parts drawings, and even wrote our own CKEditor plugins to easily embed links or image tags for these files.

You could say PW runs as a big "spider web" that connects all the apps in our company, with data being pulled in wherever necessary. There are a few apps where we thought about storing the content in PW but decided against it due to the sheer amount of data and the performance impact PW's normalization would bring. Right now we're at around 25k pages and a little over 100 fields in 50 templates. We use the UserGroups module and template settings to limit backend access to individual templates and keep the list of available templates short for our editors (~60 editors who never see more than 6 templates in their selection list).

Our intranet was built on a different CMS in 2006 and migrated to PW a few years ago, and the possibilities we gained were simply astonishing. It's always fun to have a sales rep for one of the intranet platform solutions on site and, after listing to their spiel about the great features they offer, show them what we have and ask innocently, "How much work would it be to implement all of this?" ?

  • Like 13
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...