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
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 ![]()
Please let us know if something is not clear and we will try to update this guide.