Difference between revisions of "Add a wiki database"

From Organic Design wiki
(Change source-code blocks to standard format)
Line 8: Line 8:
  
 
If you intend on creating the new wiki in a new database, you'll first need to create the new database manually, for example by logging in to MySQL:
 
If you intend on creating the new wiki in a new database, you'll first need to create the new database manually, for example by logging in to MySQL:
{{code|<pre>
+
<source>
 
create database foo;
 
create database foo;
</pre>}}
+
</source>
 
You can then make a copy of the template database and define a table prefix for the new wiki tables using our [[add-db.pl|add-db script]] as follows. The best practice is that a table prefix should always be used even if there is only one wiki, and the prefix should always end with an underscore character.
 
You can then make a copy of the template database and define a table prefix for the new wiki tables using our [[add-db.pl|add-db script]] as follows. The best practice is that a table prefix should always be used even if there is only one wiki, and the prefix should always end with an underscore character.
{{code|<pre>
+
<source>
 
/var/www/tools/add-db  /var/www/empty-1.13.sql  foo.bar_  foo.baz_
 
/var/www/tools/add-db  /var/www/empty-1.13.sql  foo.bar_  foo.baz_
</pre>}}
+
</source>
 
In this example, two wiki databases have been added at once, both in the new "foo" database we created, one wiki has tables prefixed by "bar_" and the other by "baz_". Both new wiki's are copies of the ''empty-1.13.sql'' template which was created when the ''MediaWiki-1.13'' code-base was installed into the wikia.
 
In this example, two wiki databases have been added at once, both in the new "foo" database we created, one wiki has tables prefixed by "bar_" and the other by "baz_". Both new wiki's are copies of the ''empty-1.13.sql'' template which was created when the ''MediaWiki-1.13'' code-base was installed into the wikia.
  

Revision as of 18:10, 22 May 2015

Procedure.svg Add a wiki database
Organic Design procedure

New wiki databases are added by copying from a template database for the version of MediaWiki the wiki will run on. A template exist for every code-base in the wikia because they get created during the install a MediaWiki code-base procedure.

If you intend on creating the new wiki in a new database, you'll first need to create the new database manually, for example by logging in to MySQL:

create database foo;

You can then make a copy of the template database and define a table prefix for the new wiki tables using our add-db script as follows. The best practice is that a table prefix should always be used even if there is only one wiki, and the prefix should always end with an underscore character.

/var/www/tools/add-db  /var/www/empty-1.13.sql  foo.bar_  foo.baz_

In this example, two wiki databases have been added at once, both in the new "foo" database we created, one wiki has tables prefixed by "bar_" and the other by "baz_". Both new wiki's are copies of the empty-1.13.sql template which was created when the MediaWiki-1.13 code-base was installed into the wikia.

Next

After installing a wiki database, you can then install a new wiki.

See also