head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2001.07.23.17.56.12;	author evan;	state Exp;
branches;
next	1.1;

1.1
date	2001.07.20.23.57.04;	author stack;	state Exp;
branches;
next	;


desc
@@


1.2
log
@
Issue number: 5066

Edited document for two additional steps relating to system-level updates
for domainname, and sytax errors.

- Evan
@
text
@<html>
<head>
<title>Performing an In-Situ Domainname Change</title>
</head>
<body>
<h1>Performing an In-Situ Domainname Change</h1>
<p><a href="mailto:evan@@collab.net">Evan</a>
<p>
$Date: 2001/07/20 23:57:04 $
</p>

<p>
This checklist goes over the steps needed to change the domainname of a running
Tigris installation (e.g. from <i>tigris.org</i> to <i>test_tigris.org</i>).
</p>

<h2>Update Tigris build and system settings for new name</h2>
<p>
Rebuild tigris with the new name, either by setting it directly in <code>$SANDBOX/scripts/env.sh
</code> or by changing the system's hostname.
</p>

<p>
Changing the system name will involve editing /etc/hosts and other relevant files that
vary depending upon the operating system.
</p>

<h2>Update qmail settings</h2>
<p>
For the typical qmail build, you will want to edit the <code>rcpthosts</code> and <code>
virtualdomains</code> in the <code>/var/qmail/control</code> directory to reflect the new
system name.
</p>

<h2>Get relevant scripts and set environment variables</h2>
<p>
We assume using $HOME as a base for all script downloads.  Pull down these files from 
Tigris HEAD, and set variables for the old and new domainname.  Do this even if 
the scripts are currently present in your version of tigris; those in HEAD will have 
latest bug-fixes.
</p>

<pre>
    $ cd ${HOME}
    $ cvs -d :pserver:guest@@cvs.tigris.org:/cvs login
    password: (Type in cvs guest password for tigris.org).

    $ cvs -d :pserver:guest@@cvs.tigris.org:/cvs checkout helm/scripts/domain_change.pl
    $ cvs -d :pserver:guest@@cvs.tigris.org:/cvs checkout helm/scripts/dump_tigris_db.pl

    $ export OLD_NAME=old_name.collab.net
    $ export NEW_NAME=new_name.collab.net
</pre>

<p>In addition, get these two sql scripts for dropping <a href=drop_tigris.sql>tigris</a> and
<a href=drop_issue.sql>issuezilla</a> db tables, which we will use later in this process.
TODO: These are valid for Tigris 1.0.8, may need to be updated for other versions.
</p>

<h2>Source env.sh, stop sandbox w/ sandboxctl</h2>
<pre>
    $ source /usr/local/tigris/scripts/env.sh
    $ ${SANDBOX}/scripts/sandboxctl stop
</pre>

<h2>Backup SourceCast DB tables and data directory</h2>
<p>
Ensure that enough free space exists on disk before backing up data.
</p>
<pre>
    $ ${HOME}/helm/scripts/dump_tigris_db.pl --dir=${HOME}/db
    $ tar cvf ${HOME}/data_backup.tar ${SANDBOX}/data
</pre>

<h2>Drop Mysql tables, filter text for domainname change</h2> 
<p>
In order to update the domainname in the DB tables, we first drop the table entries (but
not the databases themselves) from Mysql, and then run a perl one-liner to change text
references to the domainname.
</p>

<pre>
    $ mysql -utigris -peuphrates tigris < drop_tigris.sql
    $ mysql -utigris -peuphrates issues_5 < drop_issue.sql
    (repeat for all issues_* db's, but not for the 'issues' db.)
</pre>

<p>
NOTE: Eventually update this to reference the datadump_filter.pl script, and how to
create a loop'd drop/restore through issue_* dbs from the sh.
</p>

<p>After the tables are dropped, run the perl to change domainname references in the backed
up DB files.</p>

<pre>
    $ perl -pi -e "s/${OLD_NAME}/${NEW_NAME}/g" ${HOME}/db/*.sql
</pre>

<h2>Restore Mysql tables</h2>
<pre>
    $ mysql -utigris -peuphrates tigris < ${HOME}/db/tigris.bkup
    $ mysql -utigris -peuphrates issues_5 < ${HOME}/db/issues_5.bkup
    (repeat for all issues_* db's, but not for the 'issues' db.)
</pre>

<h2>Run change_domain.pl script</h2>
<p>This perl script updates all the domainname references in <code>${SANDBOX}/data</code>, within
the anzu, eyebrowse, and helm directories.</p>

<pre>
    $ ${HOME}/domain_change.pl --old=${OLD_NAME} --new=${NEW_NAME}
</pre>

<h2>Start sandbox</h2>
<pre>
    $ ${SANDBOX}/scripts/sandboxctl start
</pre>

<h2>Run anzu_admin</h2>
<p>Running <code>anzu_admin -op=update</code> will update mailing list entries which aren't able
to be updated by <code>change_domain.pl</code> directly</p>
<pre>
    $ ${SANDBOX}/helm/scripts/anzu_admin -op=update
</pre>

<h2>Done! Examine site to ensure name change is fully propagated</h2>
<p>NOTE: List common ways to examine name change has taken effect</p>

<hr> 
$Id: insitu_namechange.html,v 1.1 2001/07/20 23:57:04 stack Exp $ 

</body> 
</html>
@


1.1
log
@Domain name change documentation by evan@@collab.net.
@
text
@d9 1
a9 1
$Date: 2001/07/20 23:35:21 $
d14 19
a32 1
tigris installation (e.g. from <i>tigris.org</i> to <i>test_tigris.org</i>).
d84 1
a84 1
    $ mysql -utigris -peuphrates issues_5 < drop_issues.sql
d97 1
a97 1
    $ perl -pi -e `s/${OLD_NAME}/${NEW_NAME}/s` ${HOME}/db/*.bkup
d108 1
a108 1
<p>This perl script updates all the domainname references in ${SANDBOX}/data, within
d121 2
a122 2
<p>Running anzu admin -op=update will update mailing list entries which aren't able
to be updated by change_domain.pl directly</p>
d131 1
a131 1
$Id: insitu_namechange.html,v 1.2 2001/07/20 23:35:21 evan Exp $ 
@

