Loading...
 
Architecture / Installation

Architecture / Installation


Moving files in folder - strategy?

posts: 98 Greece

Hi,
This month I am moving my tiki wiki in a new server. I want to use the opportunity to move files and pictures from database to a folder (so db will stop growing fast). What is the best strategy?

a) move files from database now, in the old server (question: how do I do that?), then backup my database and folder, install tiki in new server, import database etc.

b) backup database with files still in (it's still smaller than 50 MB), install tiki to new server, then remove files from db to the folder I wish.

posts: 1817 Catalan Countries

Hi nikosal:
If you have the option in the new server to import your db from the command line ( mysql -uuser -p new_db < old_db_dump.sql ), then I would suggesst that you upgrade using your second option ("b").

Otherwise, if you have to import your db through phpmyadmin or similar in the new server, then you have to follow your option "a".

More information on how to move files from db to disk:
http://doc.tiki.org/File+Gallery+Config#Move_files_between_them

Remember that image galleries are deprecated, so sooner or later, you will have to move images in them to file galleries in new Tikis.


posts: 98 Greece

Ok, I tried option (a) today and it seems I am bit confused. Please see why:
(a) I created a file gallery in admin->features. I called it Testing_file_gallery
(b) I went to admin->file galleries and I can see this new gallery over the list of the images I have uploaded so far

(c) I went to admin home->file galleries, selected my gallery (Testing_file_gallery) and then pressed Move Files from DB to Directory, hoping that exactly that would happen. Instead I got an error message: "you must specify a directory".

Ok, obviously I have to specify this directory, but how? Exactly below "Move Files from DB to Dir" button, one can find a space to specify a directory but it is the "podcast directory" (so not my file directory).

Any ideas?


posts: 1817 Catalan Countries

once you select to store them on disk, you'll see a text field where you can indicate where to store them.
Then you can request to move files from db to disk, etc.


posts: 98 Greece

yes, I saw that text now.

Still, I cant make the move, as I get a "you must specify a directory" error in any path I use.

For example:
public_html/wiki/test/
or
wiki/test/
or just
test/

no need to say that I create these folders each time (note that my wiki folder is in public_html of my server).

I realize that the most possible thing here, is that I have not grasped the theory behind the file structure of my installation... So any help again would be useful.


posts: 98 Greece

Back here to report that I was able to make the transfer (database -> directory) in my new hosting server.

The folder I used was the /files folder inside my tiki installation. So the whole path as I see it with plesk -> files tab is /root directory/www.mysite.com/files with permissions 755 (rwx, r-x, r-x) for this folder and 644 (rw-, r- -, r- -) for all the files that were created during the transfer (after I pressed the "move files from database to directory button").

All these files have a long name like 0bf9cde136094db76b166f3ad35a0149 and browser says they are bin files. Actually, all of these were pictures with a couple of pdfs.

Let me put forward a few question, to check if I am doing ok or not.

(a) is the folder / files permissions correct and secure?
(b) is getting these bin files, instead of .jpb or .pdf files ok?
(c) if yes, how do I check these pictures with plesk? If I click them I get an "Unable to read the file or the file format is not supported" error message. Mmmm, why I was expecting a readable file format for these files?
(d) finally, my database should be a lot smaller now, right?

PS. I opened my site from another computer and every pic is in its position, so I believe not major damage done (at least regarding the readability of my site).

note: I am using 12.2

posts: 3665 United States
nikosal wrote:
(a) is the folder / files permissions correct and secure?

Appears so, yes. You can use the Tiki installer to verify that permissions are set correctly and that Tiki can fully read/write to the directory.

(b) is getting these bin files, instead of .jpb or .pdf files ok?

Yes, this is to make it more difficult for people to access the images directly from a URL (thereby by-passing the Tiki security checks. File names are hashed upon upload for your protection.

(c) if yes, how do I check these pictures with plesk? If I click them I get an "Unable to read the file or the file format is not supported" error message. Mmmm, why I was expecting a readable file format for these files?

I'm not sure what Plesk is.... You can check the files via the Tiki File Gallery. Please review the docs for details.

(d) finally, my database should be a lot smaller now, right?

Yes, if you deleted the items from the DB. As I recall, simply "moving" the files does not actually delete the record from the DB.

HTH,

- Rick | My Tiki Blog | My Tiki UserPage

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.

posts: 98 Greece

Hey Rick! Great answering me (a) to (d)!

Rick said: I'm not sure what Plesk is....

Plesk is one of the two most common tools to manage your site (the other being cpanel). There, if you click on a (say) .jpg file, it opens, you actually see the picture. I was expecting that after moving. Ok, thanks for clarifying this.

Now about that:
Rick said: Yes, if you deleted the items from the DB. As I recall, simply "moving" the files does not actually delete the record from the DB.

I guess the whole point of doing this move is to make db lighter. No point to keep images both in a directory and in db as well (as long as you properly backup your files).

So, how do I delete images from db?

posts: 3665 United States
nikosal wrote:
So, how do I delete images from db?

Did you check the DB to see if the move function removed them? I'm unsure of the exact functionality.

If the move was successful, you could simply delete the rows directly from the DB.



HTH,

- Rick | My Tiki Blog | My Tiki UserPage

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.