MagicSmoke Server Installation on Debian
=========================================
-Unfortunately this does not work entirely automaticly.
+Unfortunately this does not work entirely automatically.
1 - DocumentRoot and Web Server
--------------------------------
MagicSmoke runs with any web server that can execute PHP 5 scripts. Please be
aware that the client does enforce SSL encryption, so the web server must be
-configured accordingly.
+configured accordingly in order to work with the Qt based client.
2 - Database
-------------
-Connect to your MySQL server using a client of your choice (I'll assume the
-command line client below).
+MagicSmoke can work with MySQL or Postgres.
-Create a MySQL user - I'll assume it is called "smoke" and uses "verysecret"
+Connect to your database server using a client of your choice (I'll assume the
+command line mysql client below, commands should be similar for other clients).
+
+Create a database user - I'll assume it is called "smoke" and uses "verysecret"
as password.
mysql> CREATE USER smoke IDENTIFIED BY PASSWORD 'verysecret';
-Create a MySQL database - I'll assume it is called "smoke".
+Create a database - I'll assume it is called "smoke".
mysql> CREATE DATABASE smoke;
Give the user all rights on this database.
for multiple installations or different programs (assuming the other
programs are as tolerant as MagicSmoke).
-MagicSmoke2 can be installed in parallel to the old MagicSmoke packages, but it
-cannot access the same tables.
+MagicSmoke2 can be installed in parallel to the old MagicSmoke 1.0 packages, but it
+cannot access the same tables (upgrade is possible though).
3 - Configuring MagicSmoke
---------------------------
-Go to /usr/lib/magicsmoke-server and copy config.php.template to config.php.
+Execute /usr/share/magicsmoke-server/install.sh with your target directory
+as parameter.
+
+Now edit the config.php file, it is pretty self-explanatory.
-Now edit it, the config template is pretty self-explanatory.
+Make sure you have the right database configuration inside the config.php
+file. You will find examples for MySQL and for Postgres inside.
4 - Creating the Database Content
----------------------------------
Open a browser and direct it to admin.php in your MagicSmoke installation
(usually something like http://localhost/magicsmoke/admin.php).
-The default user name is "Admin" and the password is "SmokeInMyEye".
+The default user name is "Admin" and the password is "SmokeInMyEye" - or
+whatever you have configured.
Click the create database button.
+4.1 Initial Installation
+- - - - - - - - - - - - -
+
Create an initial administrator user.
+Done.
+
+4.2 Upgrade from MagicSmoke 1.0
+- - - - - - - - - - - - - - - - -
+
+MagicSmoke2 is not able to import old MagicSmoke Backups, you need to
+import those with an old installation and then convert them as described
+below.
+
+If you have set up the $olddb variable in your configuration MagicSmoke will
+offer to migrate data. Do not attempt migration if your new database already
+has some data stored.
+
+Please make sure that the old and new database do not share tables - at the
+very least the database name or the table prefix should be different.
+
+Simply enter "upgrade" into the input line and click the button.
+
+The upgrade may take some time - you should make sure that PHP scripts do
+not abort too soon. On a normal workstation this will take about 2-4 minutes
+for a database with a few thousand orders. If it fails you should recreate
+the new database and start over.
+
+The format of customers in the database has changed significantly.
+The upgrade process tries to guess what part of customer names and customer
+address belong to which detail. This heuristic may fail in some cases, you
+should go through your customer list and correct any mistakes afterwards.
+
+When you are done comment out the $olddb configuration to avoid initializing it
+for every call of a script.
+
+The migration process does not touch the old tables
+
+4.3 Both
+- - - - -
+
Comment out the "setAdminPassCode" line in config.php, so that noone
else can abuse this interface.
From now on you can access it with the MagicSmoke client. Your URL for the
client ends in machine.php (eg. http://localhost/magicsmoke/machine.php).
-Note: MagicSmoke2 is not able to import old MagicSmoke Backups, you need to
-import those with an old installation and then convert them. (See below.)
5 - Templates
--------------
-MagicSmoke comes with really simplistic (and ugly looking) templates for the
-web pages visible to web users.
+MagicSmoke comes with templates for the web pages visible to web users.
+It uses the Twig template engine for this. You will find some documentation
+for writing templates in the usr/share/doc/magicsmoke-server/Twig-doc .
-They are installed in /usr/share/magicsmoke-server/template .
+The templates are installed in /usr/share/magicsmoke-server/template .
+The install.sh script will put a copy into your target directory.
-Copy this directory, install magicsmoke-doc and read the chapter about web
-templates.
+Hint: install magicsmoke-doc and read the chapter about web templates.
-When you are ready redirect the server to your now template directory by
+When you are ready redirect the server to your new template directory by
editing the $template variable in config.php .
-
-Appendix A - Converting an old Database
-----------------------------------------
-
-To be written.