# SMF 2.1 Install and Upgrade Guide

Install Guide Upgrade Guide

## Installing your forum

Thank you for deciding to use, or at least try, SMF. Before you get started, please remember that there is a place for help at www.simplemachines.org if you run into any problems at all.

If you are looking to upgrade an installation of SMF, or convert from YaBB SE, you may have downloaded the wrong package. Please check the downloads page for more information.

You can find the following information in this file:

- » Minimum installation requirements
- » Recommendations for best performance
- » Upload files method 1: manually uploading files
- » Set file permissions
- » Create a database and a database user
- » Run the installer
- » Finishing the installation and cleaning up.

## Minimum installation requirements

Your server must meet a few requirements to be able to run SMF. If you are unsure as to whether your webserver meets these, please try to upgrade anyway - it should detect any problems.

- Any webserver that properly supports PHP, such as Apache or Internet Information Services (IIS).
- PHP 7.0 or higher. The following directives are required to be set correctly in php.ini:
  - the engine directive must be On.
  - the magic_quotes_sybase directive must be set to Off.
  - the session.save_path directive must be set to a valid directory.
  - the file_uploads directive must be On.
  - the upload_tmp_dir must be set to a valid directory.
- Any of the following database systems
  - MySQL 5.6 or higher.
  - MariaDB 10.0 or higher.
  - PostgreSQL 9.6 or higher.
- at least 2 megabytes of storage space in the database, although more is highly recommended.
- The database user must have at least the following privileges: SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, TRUNCATE and INDEX.
- about 20 megabytes of storage space on the web server, although more is recommended.

## Recommendations for best performance

- Windows, Linux or another Unix based operating system.
- the GNU Aspell 0.50 or higher and its dictionaries for spell checking functionality.
- Apache 2.0.0 or higher with AcceptPathInfo set to On (Apache 2 and later only) for queryless URL support.
- PHP 7.0.0 or higher, with the following set in php.ini:
  - the max_input_time directive is set to a value of at least 30.
  - the post_max_size and upload_max_filesize directives set to the size of the largest attachments you wish to be able to upload.
  - the session.use_trans_sid directive set to Off.
  - the memory_limit directive is set to at least 8M.
  - the max_execution_time directive is set to at least 15.
  - the register_globals directive is set to Off.
  - the safe mode disabled or suEXEC enabled.
- Any of the following database systems
  - MySQL 8.0 or higher.
  - MariaDB 10.2 or higher.
  - PostgreSQL 9.6 or higher.
- GD Graphics Library 2.0 or higher.

If your server does not meet these requirements, SMF may not work properly.

## Upload files method 1: manually uploading files

The first thing you need to do is upload all of the files in this package, excluding this file itself, to your server. You can upload it to any directory accessible by URL, but if you're not sure where to put it, a directory named "forum" is a good choice. You may wish to make sure that all of the folders were uploaded, such as Themes/default/languages, because some FTP clients have been known to drop files.

If you want or need to install any languages other than English, download the corresponding versions from the download page, and upload them to the same directory you uploaded SMF to. This should put additional files in Themes/default/languages and, in most cases, Themes/default/images.

### Language files

If you are using additional languages it will be useful to upload also the updated versions of the language files along with the upgrading packages. Doing so all updated text strings will appear correctly after the upgrade, and will allow the upgrade to run in your selected language.

## Set file permissions

After the install archive has been uploaded and extracted, you need to set the files' permissions. This is commonly done by use of the Unix utility CHMOD. The correct CHMOD value for SMF files is either 777, 775 or 755, depending on your hosting service. There are two methods for this step, the method used depends on the hosting service that you use.

### Setting File Permissions With the Installer

The SMF installer can set file permissions simply and easily. Navigating to the directory where SMF is located should redirect you to the install.php file and prompt the installer. For example: www.yourdomain.com/forum/install.php. If the installer detects files that need their permissions adjusted it will prompt for FTP details so it can CHMOD the files it requires for the install. This may not work on some servers.

### Setting File Permissions With FTP

Using a control panel or FTP client, file permissions can be changed quickly and easily. Usually, FTP programs will allow permissions to be changed by right-clicking files/directories and selecting "Properties", "Attributes" or "Permissions". The desired numerical value can be entered, or if provided, check boxes can be changed.

The following files and directories must be writable. Depending on how your server is set up, this could mean that they must have CHMOD values of 644, 664 or 666 for files, and 755, 775 or 777 for folders:

- /attachments
- /avatars
- /cache
- /custom_avatar
- /Packages
- /Smileys
- /Themes
- /Themes/default/languages/Install.english.php
- agreement.txt
- db_last_error.php
- Settings.php
- Settings_bak.php
- install.php

If the permission on your files or folders does not make them writable, the SMF installer will report the problem. In that case, use your FTP client or host panel to reset the permissions for the files or folders the installer reports.

## Create a database and a database user

Before running the installer, a database and a database user will need to be created. A database will store all of the information a forum requires, such as members, posts, and topics. A database user will allow the forum to access the stored information. Remember this information about the database and database user. You will need it when it comes time to run the installer.

### Creating a database using PHPMyAdmin

Most shared hosting services disable this option. If the option to create databases through PHPMyAdmin is available through the hosting service you use, the database can be created from the PHPMyAdmin home page.

### Creating a database using a control panel

Shared hosting services usually disable the ability to create a database through PHPMyAdmin. If the hosting service provides a control panel interface, then this can be used to create a database. Selecting the "MySQL Databases" or "Database Wizard" options should take you to a page prompting you to creating a MySQL database. With different hosts, these options may have different names.

SMF starting from version 2.0 has the ability to support other database types, including PostgreSQL. SMF 1.1 supports only MySQL database types.

### Creating a database user

A database user can be created through the control panel provided by your hosting service. Selecting the "MySQL Databases" or "Database Wizard" options should take you to a page, prompting you to create a MySQL database user. With different hosts, these options may have different names.

The database user requires the following permissions: SELECT, INSERT, UPDATE, DELETE, ALTER, and INDEX. Additional permissions may be granted, if desired.

## Run the installer

The final step in installing SMF is running the installer. The information from the previous steps will be used in the installation process.

The first page you see may request your FTP information. If you see this screen, it is because the installer found some files or folders with inadequate permissions for SMF to run properly. If you enter your FTP information here, the installer can automatically fix these permissions for you. Please note that the path should be the same path you see in your FTP client. For example, it might be "public_html/forum". And remember, the installer will not save your FTP password anywhere.

The SMF install screen looks different for SMF 2.1 and SMF 1.1, however, both still require the same information. Navigating to the directory where SMF is located, should redirect you to the install.php file, and prompt the installer to run. For example: www.yourdomain.com/forum/install.php

### Basic forum settings

Forum Name
  The name for the forum being installed should go here. By default this is set to "My Community". This can be changed later via the server settings section of the administration center if needed.
Forum URL
  The URL the forum can be found at, without the trailing slash. The SMF installer will most likely have this correct, so it is safe to leave this field alone.
Gzip Output
  If Gzip output tests pass, this can be used to save bandwidth and make pages load faster.
Database Sessions
  Sessions can be stored in the database, or in files. Database sessions are more reliable, secure, and may work better on sites with multiple servers.
UTF-8 Character Set
  UTF-8 character sets are useful for international forums, or forums that use languages other than English.
Allow Stat Collection
  This option allows Simple Machines to collect statistics from your forum, anonymously, so the software can grow to meet the needs of its user base.

### Database server settings

Database type
  The database schema can be selected here from a list of database schemas supported by the server being used. Newer schemas (starting from SMF 2.0) such as PostgreSQL may be listed here if available. MySQL and PostgreSQL are recommended.
Server name
  The location of the database is specified here. 99% of the time this will be localhost.
Username
  The username used for the database user should be placed here. If help is required for this, the hosting service provider should be contacted.
Password
  The password for the database user is entered here.
Database name
  The name used for the database should be placed here. If help is required for this, the hosting service provider should be contacted.
Database prefix
  The prefix for all tables associated with this install is specified here. Prefixing tables with unique prefixes enables more than one application, or SMF install, to use the same database safely.

### Creating an administrator account

The SMF installer will ask for information to create the forum's administrator account. This information includes username, password, and e-mail address, just like a regular account. Once created, this account can be used to visit the Administration Center to manage and configure the forum.

## Finishing everything up

Once all steps of the installation process have been completed, check the box to remove the install files from the server. If this does not work, they will need to be deleted via FTP. All installer files should be removed from the server once the installation process is complete, as they are a major security risk if left on a server unattended. Once SMF is installed they are no longer needed.

Good luck!
Simple Machines

## Upgrading your forum

Thank you for deciding to upgrade to SMF. Before you get started, please remember that there is a place for help at www.simplemachines.org if you run into any problems at all.

You can find the following information in this file:

- » Minimum installation requirements
- » Recommendations for best performance
- » Backing up data
- » Upload files method 1: using FTP
- » Set file permissions
- » Run the upgrading tool
- » Finishing the upgrade and cleaning up

## Minimum installation requirements

Your server must meet a few requirements to be able to run SMF. If you are unsure as to whether your webserver meets these, please try to upgrade anyway - it should detect any problems.

- Any webserver that properly supports PHP, such as Apache or Internet Information Services (IIS).
- PHP 7.0 or higher. The following directives are required to be set correctly in php.ini:
  - the engine directive must be On.
  - the magic_quotes_sybase directive must be set to Off.
  - the session.save_path directive must be set to a valid directory.
  - the file_uploads directive must be On.
  - the upload_tmp_dir must be set to a valid directory.
- Any of the following database systems
  - MySQL 5.6 or higher.
  - MariaDB 10.0 or higher.
  - PostgreSQL 9.6 or higher.
- at least 2 megabytes of storage space in the database, although more is highly recommended.
- The database user must have at least the following privileges: SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, TRUNCATE and INDEX.
- about 20 megabytes of storage space on the web server, although more is recommended.

## Recommendations for best performance:

- Windows, Linux or another Unix based operating system.
- the GNU Aspell 0.50 or higher and its dictionaries for spell checking functionality.
- Apache 2.0.0 or higher with AcceptPathInfo set to On (Apache 2 and later only) for queryless URL support.
- PHP 7.0.0 or higher, with the following set in php.ini:
  - the max_input_time directive is set to a value of at least 30.
  - the post_max_size and upload_max_filesize directives set to the size of the largest attachments you wish to be able to upload.
  - the session.use_trans_sid directive set to Off.
  - the memory_limit directive is set to at least 8M.
  - the max_execution_time directive is set to at least 15.
  - the register_globals directive is set to Off.
  - the safe mode disabled or suEXEC enabled.
- Any of the following database systems
  - MySQL 8.0 or higher.
  - MariaDB 10.2 or higher.
  - PostgreSQL 9.6 or higher.
- GD Graphics Library 2.0 or higher.

If your server does not meet these requirements, SMF may not work properly.

## Backing up data

Before starting the upgrade process, a backup of the live database should be taken. This protects the forum from accidental damage and any issues from upgrading. Although all steps are taken, and extensive testing carried out, sometimes issues develop. Therefore, having a backup is crucial. The upgrading tool can backup all database tables before it runs, however the best practice is to have a full backup available.

### Back up a database using PHPMyAdmin

PHPMyAdmin gives the option to export a database, from the initial page, select the "Export" option and follow the instructions. Select your SMF database. These are different based on host.

### Back up a database using a control panel

If your hosting service provides a control panel interface, this can be used to back up a database. Selecting the "Backups" or "Backups Wizard" options should take you to a page, prompting you to back up your database. With different hosts, these options may have different titles.

## Upload files method 1: using FTP

You can use an FTP client and an FTP access to upload the files to your server.

All you need to do is upload all of the files in this package, excluding this file itself, to your server. You should upload it to the same directory as your previous installation of SMF or YaBB SE. If you are given the option to "resume" uploads, make sure you do not do that - you must upload all of the files. You may wish to make sure that all of the files were uploaded, such as those in Themes/default/languages, because some FTP clients have been known to drop files.

### Language files

If you are using additional languages it will be useful to upload also the updated versions of the language files along with the upgrading packages. Doing so all updated text strings will appear correctly after the upgrade, and will allow the upgrade to run in your selected language.

## Set file permissions

After the upgrade archive has been uploaded and extracted, you need to set the files' permissions. This is commonly done by use of the Unix utility CHMOD. The correct CHMOD value for SMF files is either 777, 775 or 755, depending on your hosting service. There are two methods for this step, the method used depends on the hosting service that you use.

### Setting File Permissions With the Upgrader

The SMF upgrader can set file permissions simply and easily. Navigating to the directory where SMF is located should redirect you to the upgrade.php file and prompt the upgrader. For example: www.yourdomain.com/forum/upgrade.php. If the upgrader detects files that need their permissions adjusted it will prompt for FTP details so it can CHMOD the files it requires for the upgrade. This may not work on some servers.

### Setting File Permissions With FTP

Using a control panel or FTP client, file permissions can be changed quickly and easily. Usually, FTP programs will allow permissions to be changed by right-clicking files/directories and selecting "Properties", "Attributes" or "Permissions". The desired numerical value can be entered, or if provided, check boxes can be changed.

The following files and directories must be writable. Depending on how your server is set up, this could mean that they must have CHMOD values of 644, 664 or 666 for files, and 755, 775 or 777 for folders:

- /attachments
- /avatars
- /cache
- /custom_avatar
- /Packages
- /Packages/installed.list
- /Smileys
- /Themes
- agreement.txt
- db_last_error.php
- Settings.php
- Settings_bak.php
- upgrade.php

If the permission on your files or folders does not make them writable, the SMF upgrader will report the problem. In that case, use your FTP client or host panel to reset the permissions for the files or folders the upgrader reports.

## Run the upgrading tool

The final step in upgrading SMF, is to run the upgrading tool. Navigate to the directory where SMF is located. It should redirect you to the upgrade.php file and prompt you to run the upgrade. In example: www.yourdomain.com/forum/upgrade.php.

The first page you see may request your FTP information. If you see this screen, it is because the installer found some files or folders with inadequate permissions for SMF to run properly. If you enter your FTP information here, the installer can automatically fix these permissions for you. Please note that the path should be the same path you see in your FTP client. For example, it might be "public_html/forum". And remember, the installer will not save your FTP password anywhere.

### Upgrade settings

Backup database with the prefix "backup_"
  Selecting this option will get the upgrade tool to copy all data in the database before upgrading within the original database.
Maintenance Mode
  Selecting this option will place the forum into maintenance mode while upgrading rather than showing errors, this is highly recommended.
Output extra debugging information.
  The upgrade tool can give detailed information while performing an upgrade by selecting this option, it will aid the support team to solve any errors if they occur while upgrading.

## Finishing the upgrade and cleaning up

Once all parts of the upgrade have completed, check the box to remove the upgrade files from the server. If this does not work, they will need to be deleted via FTP. All upgrade files should be removed from the server once the upgrade process is complete. These files are upgrade.php and the .sql files whose name starts with 'upgrade'. They are a major security risk if they are left on a server unattended. Once SMF has been upgraded, they are no longer needed.

Good luck!
Simple Machines