putypuruty

Topic: Guide for upgrading a production site from 1.7 to 1.8

It is highly recommended to follow this guide only if you know what you are doing, else you could end up with a non-usable site.
If you don't think that you can manage, hire someone to upgrade jobberbase for you.

Goal

Upgrade a site running JB 1.7 to 1.8.

Requirements

The following must all be true before going further with this upgrade guide:

- you've installed a clean version of Jobberbase 1.8 on your personal computer or in a private folder in your site
- you've integrated your 1.7 design into the new 1.8 templates (needed because your existing 1.7 templates are not compatible with 1.8)
- you've tested your updated 1.8 code extensively and now wish to replace the production code with the updated 1.8 code

VERY IMPORTANT! Before proceeding, please make a backup of your existing Jobberbase 1.7 database and files! If you don't do this and the upgrade doesn't work for whatever reason, you could risk having a non-usable site!

Before going further, please make sure that you have easy access to the following files from your 1.7 production site because they will be required in further steps:
- config.php
- page_home.php
- the .htaccess file from the root jobberbase folder
- the .htaccess file from the jobberbase admin folder

Uploading the new code, initial setup

REMINDER! Before proceeding, please back up your production files!

- delete all the files and folders from your production site (note that if you have the 1.8 files in a private folder on your site, be sure not to delete that folder)

- do one of the following (whichever applies to you): either upload the 1.8 files and folders from your personal computer to your jobberbase site or move the 1.8 files and folders from your private folder to the folder where the production code resided

- make the following folders writable:
    /uploads
    /_templates/default/_cache
    /admin/_templates/_cache

Upgrading the database

REMINDER! Before proceeding, please back up your database!

1. open phpmyadmin and select your Jobberbase 1.7 database
2. run the following code

Code:

alter table jobs modify column `city_id` int(11) default null;

update jobs set city_id = null where city_id = -1;
delete from cities where id = -1;

drop table job_params;
drop table job_requests;
drop table job_requests_params;

CREATE TABLE IF NOT EXISTS `links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `menu` varchar(255) NOT NULL,
  `link_order` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;

INSERT INTO `links` (`id`, `url`, `name`, `title`, `menu`, `link_order`) VALUES
(1, 'widgets', 'Site widget', 'Would you like to display our latest jobs on your site?', 'primary', 1),
(2, 'about', 'About Us', 'More information about us.', 'primary', 2),
(3, 'contact', 'Contact', 'Don''t hesitate to contact us!', 'primary', 3),
(4, 'post', 'Post a new job', 'Post a new job for free!', 'footer1', 4),
(5, 'widgets', 'Site widget', 'Would you like to display our latest jobs on your site?', 'footer1', 5),
(6, 'rss', 'RSS Feeds', 'An overview of all our available RSS Feeds.', 'footer1', 6),
(7, 'about', 'About Us', 'More information about us.', 'footer2', 7),
(8, 'contact', 'Contact', 'Don''t hesitate to contact us!', 'footer2', 8),
(9, 'companies', 'Companies', 'An overview of all available companies.', 'footer3', 9),
(10, 'cities', 'Cities', 'An overview of all available cities.', 'footer3', 10),
(11, 'sitemap', 'Sitemap', 'Sitemap.', 'footer3', 11);

CREATE TABLE IF NOT EXISTS `settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `category_id` int(11) DEFAULT NULL,
  `name` varchar(64) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text,
  `data_type` varchar(255) DEFAULT NULL,
  `input_type` varchar(255) DEFAULT NULL,
  `input_options` text,
  `validation` text,
  `value` longtext,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ;

INSERT INTO `settings` (`id`, `category_id`, `name`, `title`, `description`, `data_type`, `input_type`, `input_options`, `validation`, `value`) VALUES
(1, 1, 'site_name', 'Site name', 'The name of your JobBoard, used in various templates.', NULL, NULL, NULL, 'not_empty', 'Jobberbase'),
(2, 1, 'admin_email', 'Admin Email', 'The email companies will receive mail from.', NULL, NULL, NULL, 'not_empty|is_email', 'admin@localhost.cc'),
(3, 1, 'notify_email', 'Notify Email', 'The email for receiving new job postings.', NULL, NULL, NULL, 'not_empty|is_email', 'admin@localhost.cc'),
(4, 1, 'theme', 'Theme', 'Pick the theme to use for the frontend.', NULL, 'available_themes', NULL, 'not_empty', 'default'),
(5, 1, 'html_title', 'HTML Title', 'The HTML title for the homepage.', NULL, NULL, NULL, NULL, NULL),
(6, 1, 'meta_keywords', 'Site keywords', 'Meta Keywords. Useful for Search Engine Optimization (separate by comma).', NULL, NULL, NULL, NULL, NULL),
(7, 1, 'meta_description', 'Site description', 'Meta Description Tag. Useful for Search Engine Optimization.', NULL, 'text_area', NULL, NULL, NULL),
(8, 1, 'max_cv_size', 'Max CV filesize', 'The maximum filesize for uploaded CV''s in bytes (Update accordingly in translations.ini)', NULL, NULL, NULL, 'not_empty|is_number', '3145728'),
(9, 1, 'file_upload_dir', 'Upload Directory', 'Upload directory to temporarily save CV''s. Must be writable.', NULL, NULL, NULL, 'not_empty', 'uploads/'),
(10, 1, 'apply_delay', 'Apply delay', 'The number of minutes that must pass between applications from the same IP address', NULL, NULL, NULL, 'not_empty|is_number', '0'),
(11, 1, 'old_job_notify', 'Old Job Notify', 'No. of days after which a job should be reported as old. Use 0 to disable this functionality.', 'integer', NULL, NULL, 'not_empty','40'),
(12, 1, 'date_format', 'Date format', 'The format in which dates are displayed. %d = day, %m = month, %Y = 4 digit year. Follow <a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format" target="_blank">this link</a> for more formatting options.', NULL, NULL, NULL, 'not_empty', '%d-%m-%Y'),
(13, 1, 'date_time_format', 'Date / Time format', 'The format in which times are displayed. %d = day, %m = month, %Y = 4 digit year, %H = 24-hour and %i = minute. Follow <a href="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format" target="_blank">this link</a> for more formatting options.', NULL, NULL, NULL, 'not_empty', '%d-%m-%Y %H:%i'),
(14, 1, 'sidebar_show_what', 'Sidebar - show', 'Either cities or categories can be shown in the sidebar', NULL, 'select', 'categories|cities', 'not_empty|is_alpha', 'categories'),
(15, 1, 'sidebar_only_cities_with_jobs', 'Sidebar - show only cities with jobs', 'Should the sidebar cities (if enabled) only show those that actually contain jobs?', 'boolean', 'radiobutton', 'no|yes', 'non_empty', '1'),
(16, 1, 'enable_new_jobs', 'Enable Job Posting', 'By turning this off, the only way to add jobs is through the admin-panel.', 'boolean', 'radiobutton', 'no|yes', NULL, '1'),
(17, 2, 'jobs_per_page', 'Jobs per page', 'The amount of jobs per page, before pagination is called.', 'integer', NULL, NULL, 'not_empty', '50'),
(18, 2, 'jobs_per_search', 'Jobs per search', 'The amount of jobs per page when searching.', 'integer', NULL, NULL, 'not_empty', '25'),
(19, 2, 'spotlight_jobs', 'Spotlight Jobs #', 'Amount of Spotlight Jobs to display on the front page.', 'integer', NULL, NULL, 'not_empty', '3'),
(20, 2, 'latest_jobs', 'Latest Jobs #', 'Amount of latest jobs to show on the front page.', 'integer', NULL, NULL, 'not_empty', '7'),
(21, 2, 'most_applied_jobs', 'Most Applied to #', 'Amount of most-applied-to jobs to show on the front page.', 'integer', NULL, NULL, 'not_empty', '7'),
(22, 2, 'search_method', 'Search Method', 'Choose which search method to use. ''Alternate'' checks every keyword to appear in either the title, description or cityname.', NULL, 'radiobutton', 'classic|alternate', NULL, 'classic'),
(23, 3, 'url_cities', 'Cities Cloud', 'The URL for the City Cloud page.', NULL, NULL, NULL, 'not_empty|is_url_string', 'cities'),
(24, 3, 'url_companies', 'Companies Cloud', 'The URL for the Company Cloud page.', NULL, NULL, NULL, 'not_empty|is_url_string', 'companies'),
(25, 3, 'url_job', 'Job Details', 'The URL for the Job Details page.', NULL, NULL, NULL, 'not_empty|is_url_string', 'job'),
(26, 3, 'url_jobs', 'Jobs per Category', 'The URL for the Jobs per Category pages.', NULL, NULL, NULL, 'not_empty|is_url_string', 'jobs'),
(27, 3, 'url_jobs_at_company', 'Jobs per Company', 'The URL for the Jobs per Company pages.', NULL, NULL, NULL, 'not_empty|is_url_string', 'jobs-at'),
(28, 3, 'url_jobs_in_city', 'Jobs per City', 'The URL for the Jobs per City pages.', NULL, NULL, NULL, 'not_empty|is_url_string', 'jobs-in'),
(29, 4, 'enable_recaptcha', 'Enable ReCaptcha', 'Before enabling ReCaptcha, make sure to add your private and public key.', 'boolean', 'radiobutton', 'no|yes', NULL, '0'),
(30, 4, 'captcha_public_key', 'Captcha Public Key', 'You can register these keys for free at recaptcha.net.', NULL, NULL, NULL, NULL, '12345_YOUR_PUBLIC_KEY'),
(31, 4, 'captcha_private_key', 'Captcha Private Key', 'You can register these keys for free at recaptcha.net.', NULL, NULL, NULL, NULL, '12345_YOUR_PRIVATE_KEY'),
(32, 5, 'mailer_mailer', 'Mailer', 'Send mails with PHP''s mail() function or through SMTP', NULL, 'select', 'mail|smtp', 'not_empty', 'mail'),
(33, 5, 'mailer_encoding', 'Mail encoding', 'The mail''s encoding (default is utf-8, change only if it is not working correctly)', NULL, NULL, NULL, 'not_empty', 'utf-8'),
(34, 5, 'mailer_smtp_host', 'SMTP host name', 'Host name (for example, smtp.example.com)', NULL, NULL, NULL, NULL, NULL),
(35, 5, 'mailer_smtp_port', 'SMTP port', 'Port (default is 25, change only if you know what you are doing)', 'integer', NULL, NULL, 'not_empty', '25'),
(36, 5, 'mailer_smtp_requires_authentication', 'SMTP authentication', 'Is authentication required for SMTP?', 'boolean', 'radiobutton', 'no|yes', NULL, '0'),
(37, 5, 'mailer_smtp_secure_connection_prefix', 'SMTP secure connection prefix', 'SMTP secure connection prefix. Leave empty if not specified for your host.', NULL, 'select', '|ssl|tls', NULL, ''),
(38, 5, 'mailer_smtp_username', 'SMTP user name', 'User name (for example, user@example.com)', NULL, NULL, NULL, NULL, NULL),
(39, 5, 'mailer_smtp_password', 'SMTP password', 'Password', NULL, NULL, NULL, NULL, NULL);

CREATE TABLE IF NOT EXISTS `settings_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `var_name` varchar(255) NOT NULL,
  `description` text,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

INSERT INTO `settings_categories` (`id`, `name`, `var_name`, `description`) VALUES
(1, 'Main Settings', 'main', 'The main settings for your JobberBase installation. This includes settings such as site name, meta-tags etc.'),
(2, 'Search / Pagination Settings', 'search-and-pagination', 'Settings that change the amount of jobs to display per page and which search method to use.'),
(3, 'URL Rewrite Settings', 'url-rewrite', 'You can easily change the structure of various URLs with these settings.'),
(4, 'ReCaptcha Anti-Spam', 'anti-spam', 'JobberBase has built-in support for ReCaptcha. Before you can enable this, you''ll need to register a free key at recaptcha.net.'),
(5, 'Mailer Settings', 'mail', 'You can setup the route through which emails are sent (SMTP, for example).');

3. nothing else to do, your database was upgraded to 1.8

.htaccess files

Your 1.7 .htaccess files are still compatible with 1.8. All you have to do is to overwrite the 1.8 .htaccess files with ypur 1.7 .htaccess files:

- overwrite your 1.8 .htaccess file located in the root folder with the 1.7 .htaccess file located in the root folder
- overwrite your 1.8 .htaccess file located in the admin folder with the 1.7 .htaccess file located in the admin folder

config.php

Starting with 1.8, most of the settings have moved from the config.php file into the database and are now editable from inside the admin panel (big thanks to Chronos). To keep your 1.7 settings, do the following:

- open your 1.7 config.php
- in another editor, open the config_default.php from 1.8
- from your old config.php, copy over the values that you've set for DB_HOST, DB_USER, DB_PASS and DB_NAME into the 1.8 config_default.php. Rename config_default.php to config.php and upload it into your Jobberbase 1.8 folder.

Your Jobberbase 1.8 site should now be working.

- log in as admin (your password is still the same) and go to the new page called Settings (before the Change your password link).

Click on Main settings and copy & paste the value of the following settings from your 1.7 config.php

- the value set in NOTIFY_EMAIL into the Notify Email field
- the value set in ADMIN_EMAIL into the Admin Email field
- the value set in SITE_NAME into the Site Name field
- the value set in MAX_CV_SIZE into the Max CV filesize field
- the value set in FILE_UPLOAD_DIR into the Upload Directory field
- the value set in MINUTES_BETWEEN_APPLY_TO_JOBS_FROM_SAME_IP into the Apply delay field
- choose either either cities or categories in the "Sidebar - show what" field, depending on what you've set in SIDEBAR_SHOW_WHAT
- if SIDEBAR_SHOW_WHAT = SIDEBAR_CITIES, select yes or no in the "Sidebar - show only cities with jobs" field, depending on if you want to show only cities that have jobs or also cities that currently have no jobs

Save your changes and click the "Back to overview link" on top or on the Settings link.

Now click on the "Search / Pagination Settings" link and do the following:

1. from the 1.7 config.php, copy the value set in JOBS_PER_PAGE into the Jobs per page field
2. from the 1.7 page_home.php:
- copy the value set in NUMBER_OF_MOST_APPLIED_TO_JOBS_TO_GET into the Most Applied to # field
- copy the value set in NUMBER_OF_LATEST_JOBS_TO_GET into the Latest Jobs # field

Save your changes.

That's all, you now have the same settings in 1.8 as in 1.7

If everything went well, you should now be running Jobberbase 1.8 in production smile

Please let us know if something is not clear and we will try to update this guide.

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

A Small Compulsory Update for Making Widgets Page work after the upgrade

Go to your Administration Panel and Go to Pages and Delete Widgets Page. Unless you delete this, Widgets Page won't work properly because now the Widgets are loaded from its own template file.

This change was done so that widgets page show the proper url automatically instead of localhost and does not get corrupted while editing from TinyMCE.

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

If you are facing problems on localhost related to Jobs Application and receive errors of the sort:

Code:

*Warning*: Cannot modify header information - headers already sent by
(output started at
<LocalhostPathname>\_includes\class.phpmailer.php:527) in *
<LocalhostPathname>\_includes\function.redirect_to.php* on line *30 

Then don't worry. This is not a bug. Its just that PHP Mail() function needs a SMTP Connection for sending mails on localhost.

Read this if you want to send mails on localhost: http://roshanbh.com.np/2007/12/sending- … nment.html

wolkenlos

Re: Guide for upgrading a production site from 1.7 to 1.8

hi!

I want to give some feedback - I tried to update form 1.7 --> 1.8
I followed the steps but last but not least after I done all ----> BLANK WHITE PAGE
nothing worked.... no errors ;-(

so I deleted all and reinstalled the 1.7 version

greets from austria
wolkenlos

...... sorry I forgot to report - I got one error by upating the mysql data ---> some probs with the "LINK" table so I installed without the link table (in my site I dont use it....)

Last edited by wolkenlos (2009-09-20 17:07:05)

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

You also have to update the template - this guide is only for the core files upgrade. Which theme were you using to check for upgrade. Upgrade using the default theme and then modify the theme to your needs. This is the best option.

wolkenlos

Re: Guide for upgrading a production site from 1.7 to 1.8

hello,
I am using the default theme

regards
wolkenlos

wolkenlos

Re: Guide for upgrading a production site from 1.7 to 1.8

one more question :-)
is it possible to make a new 1.8 install and import the database from 1.7??

greets
wolkenlos

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

Yes, you can import the 1.7 database into a fresh 1.8 database.

Login to your phpmyadmin and visit your 1.7 database and export your 1.7 jobs, job_applications, pages, hits, searches, spam_reports, types (only if you have extra or different job-types apart from the default 3) and cities tables.

Now go to your 1.8 table and drop the above mentioned tables and import the 1.7 exported sql data. (Always have backup of both db beforehand)

Now run these SQL Commands in your phpmyadmin:

Code:
alter table jobs modify column `city_id` int(11) default null;
update jobs set city_id = null where city_id = -1;
delete from cities where id = -1;

Your 1.8 job board should now show old data.

ltoso

Re: Guide for upgrading a production site from 1.7 to 1.8

Hi,
i have upgraded my site using the instructions above, my admin page is working but getting main page as blank, i was using default template with code for google adsense inserted into it, with img tag pointing to my own logo.

please recommend
regards
ltoso

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

Did you used {literal}{/literal} tags to insert your google ads?

ltoso

Re: Guide for upgrading a production site from 1.7 to 1.8

Nope,
just put in the adsense code

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

Insert your adsense code like this:

{literal}
ADSENSE CODE
{/literal}

And now check again.

ltoso

Re: Guide for upgrading a production site from 1.7 to 1.8

Hi,
but the adsense code was inserted in 1.7 where it was working fine, but now i overwrote the 1.8 over all the files in 1.7 and then put in the config.php settings into config.php and then replaced the .htaccess with old .htaccess files.

Please help
Regards
ltoso

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

Can you post the content of the file where you had adsense code. Also turn error reporting on in the config.php file and report back the error what you get.

ltoso

Re: Guide for upgrading a production site from 1.7 to 1.8

Hi,
following is the error i am getting

Fatal error: Smarty error: unable to write to $compile_dir '/home/xxx/domains/xxx.com/public_html/jobsusa/_templates/default/_cache'. Be sure $compile_dir is writable by the web server user. in /home/xxx/domains/xxx.com/public_html/jobsusa/_includes/smarty/libs/Smarty.class.php on line 1093

so i have made
/home/xxx/domains/xxx.com/public_html/jobsusa/_templates/default/_cache
777
and now the main page is opening fine, Thanx
one more thing how can i put my logo on this version of jobber base

Regards
Ltoso

navjotjsingh

Re: Guide for upgrading a production site from 1.7 to 1.8

Create your logo and upload it to /_templates/default/img and now open /_templates/default/css/screen.css and find this line:

Code:

div#header h1#logo a{width:390px; height:82px; outline:0; background:url(../img/jobber-logo.gif) 0 0 no-repeat; text-indent:-1000em; float:left}

and change jobber-logo.gif to your logo file.

You should try to keep the size of the logo same as the current jobberbase logo which is 375x82. If its different from it, you will need to adjust the css according to it.