Ning to BuddyPress Importer

When Ning CEO, Jason Rosenthal, announced they would be ending their free service, a lot of folks operating Ning networks have been looking for a low-cost alternative. While not 100% free, migrating your Ning network to BuddyPress is certainly an option. When we say it’s not “free,” that is because you will still have to pay for shared hosting with a company like MediaTemple, which charges $20 a month for their Grid-Service (GS) package. And, if you’re not familiar how to install WordPress on a server, then install and configure BuddyPress on top of WordPress, you may have to hire a company like Digital Strategy Works to help get you set up.

A Ning to Buddypress migration is not that easy, but it’s not that hard either. The issues you will face will mainly have to do with your host provider and whether they offer php version 5 and how much RAM they allocate to php to run the php scripts necessary to make WordPress, BuddyPress, and the Ning to BuddyPress importer work properly in tandem. Boone Gorges, the Lead Developer at CUNY Academic Commons, has developed a sophisticated WordPress to BuddyPress importer, available for download from his blog.

To extract your content from Ning, you’ll need the Ning Network Archiver. Ning created a tool to help network owners download all their content from, including users, blogs, forums, and discussions.  It will also download your music and videos as well. The Ning Network Archiver runs on the Adobe Flex and Air platforms, so you’ll be prompted to install Adobe Air before you install the exporter tool. It needs Adobe Air to run on your desktop.

Ning Network Archiver

Ning Network Archiver Tool

The Ning Network Archiver exports your text content in JSON format. JSON is a “lightweight data interchange format” based on Javascript. In addition to backing up your text content along with all posts and comments, the exporter will set up and link to directories for all your photo, video, and audio content as well. This presents a bit of a problem if your host does not provide you with enough php memory to run the Ning to BuddyPress importer tool, but we’ll get to that later.

Next, you’ll need to set up an account with a web hosting company. There are thousands of web hosting companies out there, so who do you choose. Many people who have set up Ning networks did so because they are NOT system administrators–the folks deploy web sites on servers and manager their health and well being. How do you choose?

You’ll probably want to find a WordPress friendly host. That’s not easy, because you can’t just Google “WordPress Friendly Host” and come up with a list true WordPress friendly providers. People in the WordPress community know who to use. We generally depend of MediaTemple, Bluehost, Dreamhost, and LaughingSquid. WordPress actually recommends these four partners on their web site. Digital Strategy Works generally uses and recommends MediaTemple. We like to keep everything with one provider, but we don’t begrudge you for checking out the other three we’ve listed here. They are all fine hosts and you should be able to do what you need to do with all four.

Next, you’ll want to install WordPress. Some of these hosts most likely offer a “one-click” install from the control panel provided once you set up your account. If you know how to FTP files to the server and are familiar with setting up a mySql database, you can manually set up WordPress yourself in under 5-minutes. We do it every day, so we can attest that it is really that fast.

Now for the PHP stuff….

MediaTemple is currently running php 5 on their hosting packages. WordPress runs on php 5 and has announced that it will no longer support php 4 in Q1 2011. While MediaTemple has switched to php 5, services like 1and1, HostGator, or other providers may still be running php 4. We know this to be true for 1and1 Internet, but we’re not sure about many of the others. 1and1 has announced they will switch to php 5 end of Q3 2010. In the meantime, there is a way for you to force 1and1 to upgrade your server to use php 5.

How do you know if you’re running php 4 or php 5? Easy. You can add a file to your root folder. Let’s call this file “info.php” Use a text editor or a WYSIWYG HTML editor like BBEdit (Mac) or CoffeeCup (PC) to add this text to the file:

<?php
phpinfo();
?>

Upload the file to your web server root, so the path to the file looks like this: “http://www.foo.com/info.php.” Visit the link and it will return a page that will tell you what version of php you are running, how much memory is allocated to php and other information. The page shown here is a partial view of the full page that is returned.

screen shot of a php info page

PHP 5 Info Page

When you install WordPress, you should see a file call .htaccess in your WordPress root folder. You can turn on php 5 on 1and1 Internet by inserting the following two lines to your .htaccess file.

AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

Check your info.php page again to make sure that your server is now running php 5.

Worpress 3.1 (current version) will not run on php 4, so you must have php 5 enabled to install. Once you get WordPress up and running, you’ll want to then download and install BuddyPress. What is BuddyPress? It’s a “plug-in” that extends the WordPress content management system by adding social networking features, much like how Ning currently works. It adds a social-media “layer” to WordPress. BuddyPress is not a full-on installation of WordPress itself. It’s an enhancement that works in tandem with WordPress.

After you get BuddyPress installed and activated from the Plug-Ins panel in your WordPress admin (don’t forget to activate!). you’ll notice your WordPress admin has a new “BuddyPress” panel near the top of the page in the left sidebar menu. You’ll want to click on and run the “Forum Setup” link to install BBPress, which is another WordPress plug-in that adds a discussion board to your WordPress installation. If you were running WordPress 3.1 without BBPress, you would have to install BBPress separately and then use it’s associated plug-in to connect BBPress to WordPress, so that it can hook into your WordPress user tables.

On some hosts, you’ll find that you will get a FATAL ERROR message. It says that the server tried to allocate a set amount of RAM to php, but the server needs more RAM to run the script. This is a common issue when it comes to running processor intensive scripts that complete complex functions. Most host providers allocate 30 MB to 100 MB of RAM on the server to run php scripts. I know that 1and1 allocates only 30MB while MediaTemple allows for 100MB. 1and1’s package may be cheaper than MediaTemple, but with MediaTemple, you get the flexibility to scale to 100MB out of the gate. Spending the extra $10 a month at MediaTemple is well worth the hassle.

It’s not advertised, but you can force 1and1’s settings to increase the php memory limit in two ways. The first way is by adding a line of code to your wp-config.php file, which sits in your root Wordrpress directory after install. This is the same file as your mysql settings, so you’re going to be familiar with it, because you will have already accessed it in your 5-minute install.

Use the following code to assign more Memory to WordPress:

Increase PHP Memory to 64MB

define('WP_MEMORY_LIMIT', '64M');

Increase PHP Memory to 96MB

define('WP_MEMORY_LIMIT', '96M');

You can increase the settings to 128 or even 256, but 96M should be good enough to do what you want to do.

If you are still having issues with RAM, it could be both a php memory limit issue as well as the server timing out when trying to run scripts. A web server may need more than the maximum execution time to run a script. To circumvent the host’s memory settings, you may create a text file with the “.ini” extension and call it “php.ini”.

Add this text to you file:

;;;;;;;;;;;;;;;;;;;
 ; Resource Limits ;
 ;;;;;;;;;;;;;;;;;;;

max_execution_time = 60     ; Maximum execution time of each script,  in seconds
max_input_time = 60	; Maximum amount of time each script may spend  parsing request data
memory_limit = 256M      ; Maximum amount of memory a script may consume

As you can see, this sets the max execution time for php scripts to 60 seconds, which is more than enough time to run a function.

Drop this file in your root directory of your host account, and it should override your shared memory limit settings. We’ve read that under some circumstances, you should also add this file to any folder where you need to run a php script. An example would be “wp-admin.”

Now that you’ve taken these steps, you should be able to run the Ning to BuddyPress Importer. You should turn off all other plug-ins before running the tool, except for “BuddyPress,” of course. Once you run the application, follow the instructions. The plug-in will at first attempt to bring all of your users in from the associated JSON file. The execution time may max out after importing a few hundred users. Follow the page instructions to simply refresh the page, and you’ll see that it will start dropping in the next set of users. You’ll be able to tell because each user is numbered. If it times out at, for example, 150 users, then just refresh the page and it will start bringing in 151 through the end of the next set.

Once the user tables complete, the system will show you all users that have been added. You may see an error related to each user that is calling for an avatar associated with that user. If there is no avatar available, while the user is still created in BuddyPress, the system will assign the user a temporary avatar.

The next step is blog content. Once you have completed the user tables, the system will start importing posts and comments. The system will import these, but also may show an error for a piece of content that might be missing. We noticed this and ignored it for now. The plug-in does not tell you exactly where to find what it’s not pulling in, so you’re on your own to figure it out. It’s not a big deal though, because if it didn’t exist in Ning, then it shouldn’t matter. Someone may come here and post something different about this process, and we welcome those comments and insight.

The final step is to bring in the Discussion boards with all their comments and associated media. Truth be told, this is where we are stuck right now. Despite changing all the memory settings and playing with the configuration, the Ning to BuddyPress importer is telling us it needs more memory to complete the function. We’re going to try to turn off plug-ins in other WordPress installations on the same host account and see if that works, but at the time of this post, we’re not sure. We noticed our client’s Discussion content is over 14MB, and this could be the reason we’re running out of memory. Will post an update once we figure it out. We would think that if we didn’t have such a large Discussion folder, we would be able to import without a problem. However, that’s not the case, so it’s back to the testing ground.

We hope this quick tutorial based on our findings helps you. Remember, the Ning to BuddyPress importer is a tool that Boone Gorges created in his spare time. It’s pretty awesome, but could still be a bit tricky. Once people migrate off of Ning and onto BuddyPress, the tool will be rendered moot. But, for now, it’s a necessity for sure.

Leave a Reply