4images Forum & Community
4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: Ernesto Taseffa on March 03, 2003, 08:54:03 AM
-
.
-
all 4images settings are stored in the database. so, that what u need backup and restore on another server.
-
.
-
.
-
mmmh,
I did a backup of my old board, I copied that backup with ftp on the new server, where i did a fully fresh install of 4images successfully before.
I opened the admin menu on the new board, went to back up, selected the backup of my other board and clicked on restore. It accepted this restore in the admin and I got the message that this action was successfully.
BUT if I look now in categoreis etc., nothing of my old board is there. No categories, no usergroups and the 4dark template is also not availble.
It just still looks like a fresh install. Did I miss here anything to do?
Dirk
The best way to backup/restore database, is using phpmyadmin script www.phpmyadmin.net
since u said that u installed many mods, I'd suggest u just copy whole 4images dir, that's safe. ofcourse with database.
-
.
-
.
-
.
-
it's pretty much simple to do.
------------------------
------BACKUP--------
------------------------
1. Login to your database.
2. If u have chose to chose between different databases, then, chose 4images
3. on left side u should see all tables, such as 4images_categories and so on.
4. on right side, should be a link Export. Click on it.
5. sellect all tables that belong to 4images: 4images_categories
4images_comments
4images_groupaccess
4images_groupmatch
4images_groups
4images_images
4images_images_temp
4images_lightboxes
4images_postcards
4images_sessions
4images_sessionvars
4images_settings
4images_users
4images_wordlist
4images_wordmatch
6. Check Structure and data ( I'm not sure options on the bottom such as:
Add 'drop table'
Complete inserts
Extended inserts
Enclose table and field names with backquotes )
I dont check them, and everything works just fine... 8)
7. Check "Save as file"
8. Click "Go"
---------------------
-----RESTORE-----
---------------------
1. Select database u want use for 4images, or create it manualy
2. After u selected database, u'll see on right side link SQL, click on it.
3. Click "Browse" button, select your backup file (it must be not compressed file, plain .sql)
4. Click "Go"
-
.
-
(The old board, where the backup comes from has a different prefix and url and server, if that matters)
that's the problem.
because when u do backup this way, it will save/restore exactly same as the original.
try to open .sql backup file and change all names from old db to new db names. 8O
-
.
-
I changed my server
i uploaded all files
i changed the config.php from 4Images
and restored my database on the new server with phpMyAdmin!
Everything works
But when i try change something like userinformation in the control panel nothing changes.
When i try to create a new category , i get the statement:
Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 78
Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 81
Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 78
Warning: MkDir failed (Permission denied) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 81
Kategorie erfolgreich hinzugefügt (Category adding succeeded in english)
if i delete this cateogorie i get the following message:
Kategorie erfolgreich gelöscht Test (ID: 15)
-» Bild erfolgreich gelöscht (Pics deleting succeeded in english)
Warning: Unlink failed (No such file or directory) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 101
Warning: Unlink failed (No such file or directory) in /users/coolfreepage.com/brkcrew/4images1.7/4images/admin/categories.php on line 101
-» Kommentare erfolgreich gelöscht (comments deleting succeeded in english)
Error Log:
Es sind Fehler bei folgenden Aktionen aufgetreten:
(The following error occurred in enlish)
Fehler beim Löschen der Bild-Datei (Test, ID: 15)
(Error deleting Pic-File (........))
Fehler beim Löschen der Thumbnail-Datei (Test, ID: 15)
(Error deleting Thumbnail-File(.........)
whats wrong ? what will i have to change if i move to a new server .
i changed the config.php . I edited my new DB Name and password .....
is there any file what have to be changed?
-
I changed my server
i uploaded all files
i changed the config.php from 4Images
and restored my database on the new server with phpMyAdmin!
........
whats wrong ? what will i have to change if i move to a new server .
i changed the config.php . I edited my new DB Name and password .....
is there any file what have to be changed?
did u check permissions? ;)
-
where do i do this?
and how?
i thought only the config.php includes information about the database ?!!?
i think i have an idea , i have to change the chmode in my folder do u know how it has to be? 664 ?
-
where do i do this?
8O
CHMOD?
check /docs/installation.txt
-
I did that and then uploaded the files and when I go to the page I get this:
template_extension)) { $template = ""; } else { $main_template = $template; } } else { $template = ""; } include(ROOT_PATH.'includes/page_header.php'); if (!empty($template)) { $clickstream = "url(ROOT_PATH."index.php")."\">".$lang['home']."".$config['category_separator'].str_replace("_", " ", ucfirst($template)); $site_template->register_vars("clickstream", $clickstream); $site_template->print_template($site_template->parse_template($main_template)); include(ROOT_PATH.'includes/page_footer.php'); } //----------------------------------------------------- //--- Show Categories --------------------------------- //----------------------------------------------------- $categories = get_categories(0); if (!$categories) { $categories = $lang['no_categories']; } $site_template->register_vars("categories", $categories); unset($categories); //----------------------------------------------------- //--- Show New Images --------------------------------- //----------------------------------------------------- $imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']); if ((substr($config['image_table_width'], -1)) == "%") { $imgtable_width .= "%"; } $additional_sql = ""; if (!empty($additional_image_fields)) { foreach ($additional_image_fields as $key => $val) { $additional_sql .= ", i.".$key; } } $num_new_images = $config['image_cells']; $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")." FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") ORDER BY i.image_date DESC LIMIT $num_new_images"; $result = $site_db->query($sql); $num_rows = $site_db->get_numrows($result); if (!$num_rows) { $new_images = "
"; $new_images .= $lang['no_new_images']; $new_images .= "
"; } else { $new_images = "
"; $count = 0; $bgcounter = 0; while ($image_row = $site_db->fetch_array($result)){ if ($count == 0) { $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2; $new_images .= "
\n"; } $new_images .= "
\n"; $count++; if ($count == $config['image_cells']) { $new_images .= "
\n"; $count = 0; } } // end while if ($count > 0) { $leftover = ($config['image_cells'] - $count); if ($leftover >= 1) { for ($f = 0; $f < $leftover; $f++) { $new_images .= "
\n"; } $new_images .= "
\n"; } } $new_images .= "
\n"; show_image($image_row); $new_images .= $site_template->parse_template("thumbnail_bit"); $new_images .= "\n
\n \n
\n"; } // end else $site_template->register_vars("new_images", $new_images); unset($new_images); //----------------------------------------------------- //--- Print Out --------------------------------------- //----------------------------------------------------- $site_template->register_vars(array( "msg" => $msg, "clickstream" => $clickstream )); $site_template->print_template($site_template->parse_template($main_template)); include(ROOT_PATH.'includes/page_footer.php'); ?>
and in install.php
$val) { $array[$key] = (is_array($val)) ? addslashes_array($val) : addslashes($val); } return $array; } if (get_magic_quotes_gpc() == 0) { $HTTP_GET_VARS = addslashes_array($HTTP_GET_VARS); $HTTP_POST_VARS = addslashes_array($HTTP_POST_VARS); $HTTP_COOKIE_VARS = addslashes_array($HTTP_COOKIE_VARS); } if (@file_exists(ROOT_PATH."config.php")) { @include(ROOT_PATH.'config.php'); } if (defined("4IMAGES_ACTIVE")) { header("Location: index.php"); exit; } if (isset($HTTP_GET_VARS['action']) || isset($HTTP_POST_VARS['action'])) { $action = (isset($HTTP_GET_VARS['action'])) ? stripslashes(trim($HTTP_GET_VARS['action'])) : stripslashes(trim($HTTP_POST_VARS['action'])); } else { $action = ""; } if ($action == "") { $action = "intro"; } $lang_select = ""; $folderlist = array(); $handle = opendir(ROOT_PATH."lang"); while ($folder = @readdir($handle)) { if (@is_dir(ROOT_PATH."lang/$folder") && $folder != "." && $folder != "..") { $folderlist[] = $folder; } } sort($folderlist); for($i = 0; $i < sizeof($folderlist); $i++) { $lang_select .= " ".$folderlist[$i]." \n"; } closedir($handle); if (isset($HTTP_GET_VARS['install_lang']) || isset($HTTP_POST_VARS['install_lang'])) { $install_lang = (isset($HTTP_GET_VARS['install_lang'])) ? trim($HTTP_GET_VARS['install_lang']) : trim($HTTP_POST_VARS['install_lang']); } if (empty($install_lang) || !in_array($install_lang, $folderlist)) { $install_lang = "deutsch"; } $lang = array(); include(ROOT_PATH.'lang/'.$install_lang.'/install.php'); $db_servertype = (isset($HTTP_POST_VARS['db_servertype'])) ? trim($HTTP_POST_VARS['db_servertype']) : "mysql"; $db_host = (isset($HTTP_POST_VARS['db_host'])) ? trim($HTTP_POST_VARS['db_host']) : ""; $db_name = (isset($HTTP_POST_VARS['db_name'])) ? trim($HTTP_POST_VARS['db_name']) : ""; $db_user = (isset($HTTP_POST_VARS['db_user'])) ? trim($HTTP_POST_VARS['db_user']) : ""; $db_password = (isset($HTTP_POST_VARS['db_password'])) ? trim($HTTP_POST_VARS['db_password']) : ""; $table_prefix = (isset($HTTP_POST_VARS['table_prefix'])) ? trim($HTTP_POST_VARS['table_prefix']) : "4images_"; $admin_user = (isset($HTTP_POST_VARS['admin_user'])) ? trim($HTTP_POST_VARS['admin_user']) : ""; $admin_password = (isset($HTTP_POST_VARS['admin_password'])) ? trim($HTTP_POST_VARS['admin_password']) : ""; $admin_password2 = (isset($HTTP_POST_VARS['admin_password2'])) ? trim($HTTP_POST_VARS['admin_password2']) : ""; include(ROOT_PATH.'includes/constants.php'); if ($action == "downloadconfig") { header("Content-Type: text/x-delimtext; name=\"config.php\""); header("Content-disposition: attachment; filename=config.php"); $config_file = stripslashes(trim($HTTP_POST_VARS['config_file'])); echo $config_file; exit; } ?>
$val) { $lang[$key] = sprintf("%s *", $lang[$key]); } $action = "intro"; } else { ?>
connection) { $error_log[] = "No connection to database!"; } $site_db->no_error = 1; include(ROOT_PATH.'includes/db_utils.php'); $db_file = ROOT_PATH.DATABASE_DIR."/default/".strtolower($db_servertype)."_default.sql"; $cont = @fread(@fopen($db_file, 'r'), @filesize($db_file)); if (empty($cont)) { $error_log[] = "Could not load: ".$db_file; } if (empty($error_log)) { $cont = preg_replace('/4images_/', $table_prefix, $cont); $pieces = split_sql_dump($cont); for ($i = 0; $i < sizeof($pieces); $i++) { $sql = trim($pieces[$i]); if (!empty($sql) and $sql[0] != "#") { if (!$site_db->query($sql)) { $error_log[] = $sql; } } } $admin_pass_md5 = md5($admin_password); $current_time = time(); $sql = "UPDATE ".$table_prefix."users SET user_name = '$admin_user', user_password = '$admin_pass_md5', user_lastaction = $current_time, user_lastvisit = $current_time WHERE user_name = 'admin'"; if (!$site_db->query($sql)) { $error_log[] = $sql; } $sql = "UPDATE ".$table_prefix."settings SET setting_value = '$install_lang' WHERE setting_name = 'language_dir'"; if (!$site_db->query($sql)) { $error_log[] = $sql; } } if (empty($error_log)) { $config_file = ''; @umask(0111); $fp = @fopen('./config.php', 'w'); $ok = @fwrite($fp, $config_file); if (!$ok) { $cant_write_config = 1; } @fclose($fp); $msg = "
".$lang['install_success'].""; if (!isset($cant_write_config)) { $msg .= "
".$lang['install_success_login']; } else { $msg .= "
".$lang['config_download_desc']; $msg .= ''; $msg .= ''; } $msg .= "
"; } else { $msg = $lang['database_error']; $error_msg .= "
"; foreach ($error_log as $val) { $error_msg .= sprintf("
%s
", $val); } $error_msg .= "
"; } ?>
"; $db_types = array("mysql"); $handle = opendir(ROOT_PATH."includes"); while ($file = @readdir($handle)) { if (preg_match("/db_(.*)\.php/", $file, $regs)) { if ($regs[1] != "mysql" && file_exists(ROOT_PATH."data/database/default/".$regs[1]."_default.sql")) { $db_types[] = $regs[1]; } } } foreach ($db_types as $db_type) { $db_servertype_select .= "".$db_type.""; } $db_servertype_select .= ""; if (!empty($error)) { $lang['start_install_desc'] = $lang['start_install_desc'].sprintf("
%s *", $lang['lostfield_error']); } ?>
Powered by 4images
Copyright © 2002 4homepages.de
-
are u sure that your host supports PHP?
-
I think so - they claim they do :?
EDIT: OK, nevermind, my host had the default PHP setting to off, didn't notice at first.
-
OK, but now I get this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/allalias/allalias.net/includes/db_mysql.php on line 39
DB Error: Could not connect to the database server (, ).
NOTE: I first tried localhost as the dbhost but it didn't allow it, so I switched to the IP, and it "worked", but I got the above error.
-
OK, but now I get this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/allalias/allalias.net/includes/db_mysql.php on line 39
DB Error: Could not connect to the database server (, ).
NOTE: I first tried localhost as the dbhost but it didn't allow it, so I switched to the IP, and it "worked", but I got the above error.
ask your host about correct info how to use MySQL server.
-
EDIT: Thanks, I actually realized that when I was saving a file on my computer to upload it wasn't overriding the old one, stupid me. Works now :)
-
I changed the permissions like in the installation.txt chmod 777
Set permissions for the following directories:
(drwxrwxrwx) : data
chmod 777 (drwxrwxrwx) : data/database
chmod 777 (drwxrwxrwx) : data/media
chmod 777 (drwxrwxrwx) : data/thumbnails
chmod 777 (drwxrwxrwx) : data/tmp_media
chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
chmod 777 (drwxrwxrwx) : templates
chmod 777 (drwxrwxrwx) : templates/default
chmod 777 (drwxrwxrwx) : templates/default/media
Set permissions for the following files:
chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default"
chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default/media"
i can add categories but if i upload pics and check for new images they are not added to the category.
also if i add manually a new user , he is not added !
-
any error messages?
-
no ,
no messages , nothing der screen reloads ! but nothing is changed
-
does it say "User added" ?
I still think u missed somewhere in the permissions...
btw, is your host running *NIX system or windows? (CHMOD doesnt work on windows systems)
-
Requirements:
(http://www.4homepages.de/forum/Themes/classic/images/expand.gif) phpMyAdmin on both servers (unless you know what you mean with servers)
(http://www.4homepages.de/forum/Themes/classic/images/expand.gif) very good FTP cleint (I suggest Flash FXP)
(http://www.4homepages.de/forum/Themes/classic/images/expand.gif) very good text editor (I suggest UltraEdit-32)
(http://www.4homepages.de/forum/Themes/classic/images/expand.gif) patience
(http://www.4homepages.de/forum/Themes/classic/images/expand.gif) a little bit of knowledge of how 4images works
Can we sum the steps as:
1) Back Up the database as .sql or .zip [Old Server] *.sql recommended
2) Back Up the /4images directory entirely [Old Server]
3) Restore the database [New Server] 1 *see below
4) Note down the database information (domain, user, database, etc.) [New Server]
5) Restore /4images directory [New Server]
6) Edit config.php and other .phps under /4images to match the new domain, user, database, etc [New Server] 2 *see below
If you are making a dummy duplicate of 4images, above should work, because all the prefix and subfolders & data should match each other.
Only problem could be if there is a mod which needs to link to db and you forgot to rename/modify & give it the new db specs.
1) While restoring database, you may runinto problems during importing or while restoring the db.sql into your new db. This can cause time out and 50x errors with your server. To avoid this try restoring 4images_ tables one at a time. Try exporting 1 table, and importing 1 table, and so on.. such as start with 4images_categories and export it, later 4images_comments.. and so on. You may run into problem with tables that are over 750kb, depending on your connection and the speed of your server. What to do? Then as v@no suggested try opening the .sql file and use SQL to run SQL query/queries on database. 4images_wordmatch can cause a problem, because on mine it was 1.7MB, which consists of simple commands like
INSERT INTO 4images_wordmatch VALUES (1, 41, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 40, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 39, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 38, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 37, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 36, 0, 1, 0);
INSERT INTO 4images_wordmatch VALUES (1, 35, 0, 1, 0);
so it is pretty easy to input line by line, try doing 750 lines at a time.
2) There are only 3-5 files which needs to link to db, if you think you might have more, you will use your favorite search tool to search for file "Containing Text = xxxxx (your db or your db password)" and the result files needs to be modified to your new db information. The best text editor I found is UltraEdit-32 which can find and replace any given words in all open files at once.
Keep reading for other updates and details.
Good Luck.
:mrgreen:
-
that is perfect ;)
-
Boy, it means a lot coming from you.
Anyway, I am working on my new server now, I just set up phpmyadmin, *new version seems sweet, and right now will export the whole db out of my old server.
*edited and moved above.
Good Luck
-
a quick update:
phpmyadmin restricts importing of queries to (Max: 8,192KB).
I was lucky to have about 7500KB, even so, it was large enough to put the enquery into "Time Out". Therefore, the best way to do this would be table, try exporting & importing 5 tables at a time.
-
actualy for me its easier just open the exported .sql file in any text editor (even notepad would work) and chop it down on many little pieces.
Another alternative is download some mysql manager software (I've tryed Navicat) which can import/export any size queries.
-
Thanks, chopping up worked. Since the wordmatch was all single entries, although the size is not the same at the end,
Format: fixed
Rows: 21,445
Row length ø: 10
Row size ø: 22 Bytes
against
Format : fixed
Rows: 21,445
Row length ø: 10
Row size ø: 21 Bytes
hopefully the row size will not make difference ?
These match:
image_word_id -- UNIQUE -- 21445
image_word_id -- UNIQUE -- 21445
Addition:
It seems like Windows search is having problem finding the db name in .php files in /4images.
I will check it once again, but maybe the whole word matching might be the problem. Will look for 3rd party search tool with powerful file reading options.
thanks
-
Just to confirm one quick thing and to make this a topc where everyone can easily move their 4images site in its entirety, I just edited my previous step by step instruction.
I just did it, and it works great.
original site:
http://www.34tr.com
backed up site:
http://s116975426.onlinehome.us/4images/
enjoy, and please let me know if you see anything acting up. ;)
-
a quick note:
if u going to "chop" the .sql file, then u can remove any INSERT INTO 4images_wordmatch VALUES ()
and then use this plugin instead:
http://www.4homepages.de/forum/index.php?topic=1096.0
also, sessions and session_vars inserts dont needed
-
hi v@no,
so with this setup, we don't really need 4images_wordmatch at all right, as long as it has only one or if we really don't need search stats? I am kind of confused what wordmatch does.
Thanks.
-
well, what I was trying to say is there is a plugin that rebuilds search index (wordmatch) so, why whould u waste your time on importing the search index if u can do it with the plugin?
-
Hello.
I have just moved 4images v.1.7 to a new server and everything, but one thing, seems to work.
That one thing, is that i can´t upload new pictures ? Every time I try it tells me to:
Please recheck the marked fields - and its the image upload field.
All chmod should be in order.
I can import pictures using ftp and check new images.
-
Problem solved - it was an setup error at my host.
-
I moved to a new server, tried to backup from the admin panel, said ok, nothing really happened.
Came here, found the forumtopic, read it all. Did everything as told and still got the following error:
DB Error: Bad SQL Query: SELECT setting_name, setting_value FROM 4images_settings
Table 'graffiti.4images_settings' doesn't exist
I had to change the db name, cause the new server provider doesnt support _ character. Changed it in backup.sql and config.php, couldnt though find any other php files with db name in it. Or is there?
tnks
-
check includes/constants.php
-
checked, nothing there.
-
well, I have no idea what u've changed in the .sql file, but obviosly your backup copy does not create 4images_settings table in the database.
make sure u've changed table names (if u did) with a prefix that matched with $table_prefix in config.php
-
I just moved my gallery from one server to a new one and re-installed 4images. I want all of my old settings and users set on the new server so I followed the instructions to upload the backup SQL file in phpMyAdmin. However, near the end, I get this error message:
Error
SQL query:
CREATE TABLE 4images_categories(
cat_id int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
cat_name varchar( 255 ) NOT NULL default '',
cat_description text NOT NULL ,
cat_parent_id int( 10 ) unsigned NOT NULL default '0',
cat_hits int( 10 ) unsigned NOT NULL default '0',
cat_order int( 10 ) unsigned NOT NULL default '0',
auth_viewcat tinyint( 2 ) NOT NULL default '0',
auth_viewimage tinyint( 2 ) NOT NULL default '0',
auth_download tinyint( 2 ) NOT NULL default '0',
auth_upload tinyint( 2 ) NOT NULL default '0',
auth_directupload tinyint( 2 ) NOT NULL default '0',
auth_vote tinyint( 2 ) NOT NULL default '0',
auth_sendpostcard tinyint( 2 ) NOT NULL default '0',
auth_readcomment tinyint( 2 ) NOT NULL default '0',
auth_postcomment tinyint( 2 ) NOT NULL default '0',
sort_order varchar( 5 ) NOT NULL default 'ASC',
sort_field varchar( 20 ) NOT NULL default 'image_name',
PRIMARY KEY ( cat_id ) ,
KEY cat_parent_id( cat_parent_id ) ,
KEY cat_order( cat_order )
) ENGINE = MYISAM DEFAULT CHARSET = latin1
MySQL said: Documentation
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 22
My new host (AN Hosting) uses phpMyAdmin 2.6.4.
Please help!
-
For those of you having problems with your host, I will install the script for free and host it for $6.95 a month. Send me a PM if your interested. www.web-rocket.com