4.1. Upgrading from Pivot 1.x
Since PivotX is an entirely different beast than Pivot 1.x, upgrading from Pivot 1.x will take a while to do. If you have a small bit HTML, FTP skills, you should be fine though. If you get stuck, don't hesitate to ask questions on the forum.
Besides following these instructions, you can also just set up a new PivotX install, to get the hang of things, and when it's configured to your liking, you can convert your old entries.
Note: It IS very important to read this entire chapter before getting started. You don't want to mess up your PivotX install, do you?
The conversion is divided into 4 steps.
- Backing up Pivot, making sure the Database is a-OK.
- Installing PivotX
- Converting your old entries and settings.
- Setting up the templates
Step 1. Backing up
PivotX uses UTF-8 as the one and only character set. This means that you might need to convert your entries to UTF-8 in order to import them, without any glitches. If you don't you might lose characters that are not in the 'normal' western european character set. We're also going to make sure all your DB entries are working well, and repair them if they're not.
1. Backing up
Make a backup of your entire web site. That way, if you make a mistake, or something goes wrong, you'll always have a copy of your entries, images and whatnot. It's probably easiest to make the backup using your FTP program. Make sure you grab at least the pivot/, images/ and extensions/ folders.
2. Repairing your Database entries.
Sometimes an entry can get corrupted, but most often we can repair this without any loss of data. To do this, download our db repair tools from this location: www.pivotlog.net/filebase/Misc_Files/repair_db_utility_1.0.zip. The zip file contains a readme.txt file, with all the details.
3. Converting your database to use UTF-8 for encoding.
You might need to convert your current Database to UTF-8, but it might also already be in the correct encoding. To check this, log into your Pivot, and go to 'My info'. There you'll see the language settings. If it says 'Nederlands (Dutch / UTF)', or any other language with the 'UTF-8' appended to the name, you're in luck, and you can skip this step.
If it says 'English' or any other language without the 'UTF-8' appended to the name, you'll have to convert your entries to UTF-8. Most likely you're current character set will be in ISO-8859-1 encoding, so you can use our Charset Converter to convert all entries. You can get the file here: forum.pivotlog.net/viewtopic.php?t=12267. Extract the .zip-file, upload it to your Pivot folder, open it in your browser, and follow the on-screen instructions.
4. Backup again.
Ok, so far so good. You just need to make another backup of the pivot/db/ folder. Keep this one seperate from the backup you made earlier.
Step 2. Installing PivotX
Rename your pivot/ folder to pivot.old, so you're not going to put PivotX into the same folder. That would make a mess of things!
Next, install PivotX, according to the (brief) instructions here: pivotx.net/#installation, but do not login, or set up the admin user just yet! Just copy the files, and set the filerights for now.
Some things to do/check:
- Copy the Pivot entries to PivotX, i.e., move the folders pivot.old/db/standard-NNNNN to pivot/db/.
- If you want to use your existing Pivot templates in PivotX (instead of starting from scratch), you must copy the contents of pivot.old/templates. PivotX supports themes, so you should make a new folder like pivot/templates/oldsite/, and copy all the files into there.
- If you want to keep your existing users, categories and general settings (from Pivot), copy pivot.old/pv_cfg_settings.php to pivot/pv_cfg_settings.php.
- If you want to keep your existing weblogs, copy pivot.old/pv_cfg_weblogs.php to pivot/pv_cfg_weblogs.php.
Now you are ready to launch PivotX - visit yourdomain.net/pivot/ and follow the instructions to set up the first user.
Step 3. Converting your entries
If you've chosen to use 'flat files' as DB, you will immediately see all your entries on the PivotX dashboard. You can skip to the next section.
If, on the other hand, you've chosen to use MySQL as a DB, you'll see just two entries, and one page. You'll need to convert your old file-based entries to MySQL.
Rename pivot/convertentries2sql.phps to pivot/convertentries2sql.php, and open the page in your browser. Follow the on-screen instructions to convert all your entries to MySQL.
By now you can visit your new site by clicking on the sitename right under the PivotX logo, in the top left corner of the PivotX administration interface. Maybe it looks a bit broken, but we're going to fix that in the next section.
You can now delete pivot.old, pivot/pv_cfg_settings.php and pivot/pv_cfg_weblogs.php. If you're using a MySQL database now, you can also delete the pivot/db/standard-NNNNN folders.
You did remember to make that backup, didn't you? ;-)
Step 4. Setting up Templates.
Now you're going to have to decide whether you're going to tweak and adapt your old templates to use them with PivotX, or if you're going to use the default Theme, or download a new Theme for PivotX (there will soon be themes to chose from on themes.pivotx.net).
Whatever you choose, start by selecting the right templates in Administration > Weblogs > Your weblog > Templates. Here you can select the templates you'd like to use for the various types of pages:
Now you'll have to check all the templates, seeing if there are things that might require fixing.
Note: If you're used to clicking the 'rebuild frontpage' button every time you change a template, you can let go of that habit now. PivotX renders all pages on the fly, so there's no need to rebuild anything.
One thing you'll most likely bump into, is that the [[weblog]]-tag works quite different now. Because we use a real template engine now, there's no need to use hackish includes. In Pivot 1.x the subweblog tag looked something like this:
[[subweblog:standard]]
Now, it might look like this: <!-- begin of weblog 'standard' -->
[[ subweblog name="standard" ]][[ literal ]]
<!-- entry '[[title]]' -->
<div class="entry">
<h2>
<a href="[[entrylink]]">[[title]]</a>
</h2>
<p class="date">
[[ date format="%dayname% %day% %monthname% %year% at %hour12%:%minute% %ampm%" ]]
[[ editlink format="Edit" prefix=" - " ]]
</p>
[[introduction]]
[[more]]
<p class="entryfooter">
<span class="meta">
[[user field=emailtonick ]] |
[[ singlepermalink text="¶" title="Permanent link to entry '%title%'" ]] |
[[ category link=true ]] |
</span>
<span class="comments">
[[commentlink]]
</span>
[[tags prefix="<span class='tags'>" postfix="</tags>" ]]
</p>
</div>
[[ /literal ]][[ /subweblog ]]
<!-- end of weblog 'standard' --> The [[subweblog]]-tag used to have only one parameter: the subweblog's name. In the Pivot Interface you'd have to assign that to a sub-template to use for the weblog.
PivotX on the other hand, will just use whatever's between the [[subweblog]] and [[/subweblog]] tags to render your weblog. Don't remove the [[literal]]-tags, since they prevent PivotX from parsing the contents too early.
More details on the [[subweblog]] tag can be found on the page listing all the tags, here: docs.pivotx.net/doku.php?id=template_tags#subweblog_weblog
Don't forget to show off your newly converted site on the forum, after you're done! :-)