Jump to content
The Uniform Server Community

Run from CD without copying database


 Share

Recommended Posts

Hi,

 

I want to run an offline copy of a website with a large database(200+ MB) from CD/DVD. I came across uniserver while looking for a solution. I have looked at the run from CD Oily Rag, but I don't want to copy the database across since there will be no writing to it by the end user.

 

 

Will Uniserver do this? And if so, what additional changes will I need to make to enable me to do this?

 

Any help appreciated

Link to comment
Share on other sites

I found your post interesting because I am currently working on a new plugin for Mona, will add this feature as a user option.

 

However the following is a solution for 3.5 note you do need to write some small temp files to c drive. To prevent copying that large database these are the changes required:

 

Assumes you are using uscd4.exe plugin

 

1] Prevent copying database:

 

Edit File: udrive\plugins\uscd2\uscd\new_Server_Start.bat

 

Delete the following lines:


:Copy complete database
XCOPY "%CD%\udrive\usr\local\mysql\data" %ustemp%\mysql\data\ /s /q
[/code]

2] Prevent update MySQL path 1

 

Edit file: udrive\plugins\uscd2\uscd\cd_mode.pl

Change this block of code:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"datadir = \"/usr/local/mysql/data/\""); # search for
push(@mpg,"datadir = \"$tpath/mysql/data/\""); # replace with
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

To:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

 

3] Prevent update MySQL path 2

 

Edit file: udrive\plugins\uscd2\uscd\us_mode.pl

Change this block of code:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"datadir = \"/usr/local/mysql/data/\""); # search for
push(@mpg,"datadir = \"$tpath/mysql/data/\""); # replace with
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

To:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

That’s all you need to change!

 

All the best

Ric :)

Link to comment
Share on other sites

  • 4 weeks later...

just as a thought: as mysql seems to be troublesome, you could export all mysql data and import it to a SQLite db. in that case you would not rely on the mysql server since the sqlite php extention messes with it.

as structure and commands are the same, you would only need to batch replace the mysql_* commands to sqlite_* ones in the php files.

 

downside: for every msql connection establishing, the replacement would be, for example, sqlite_open( string $filename )

 

i know, thats even more work... but could be usefull for a cd version...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...