Transfer Joomla subdirectory subdomain to Root without changing database - joomla

I have a Joomla 2.5 development website www.mysite.com/dev. It is ready to migrate and replace the old site in root folder. Someone suggested to zip the entire subdirectory, delete the root joomla files, extract subdirectory files to root then edit the configuration php.
But how about the database? Do I need to change anything? If not, does that mean both dev and live will be linking to the same database? Will that cause a problem?

The physical location of the files in your web space is independent from the connection to the database so you can move the files to another folder and Joomla will usually work just fine.
It's possible that the development and live website point to the same database but this would not be the best way to create a new development website unless they use different prefixes. You can see which database Joomla is connecting to in Global Configuration > Server or in the configuration.php file.
You will also need to update the paths to the tmp and logs folders in Global Configuration.
You may need to update the $live_site parameter in the configuration.php file if it has been specified.
You may also need to update the .htaccess file in case any absolute or relative paths are specified in there.
When I make a development website live, I usually copy all the files and folders in the root of the website (except the /dev folder) to /old and then move everything from /dev to the root folder. You then have the old website available if needed for a while.

If you move your site from the /dev/ folder to the root folder, you don't have to change the settings for your database. The database connection will still work just fine.
I would, however, suggest to remove the files from the /dev/ folder once you're done to avoid a penalty for duplicate content. :)

Related

Directory location for writing cache file

Hi I am trying to find out what is the best location to save a cache file.
I have an Windows form application that updates user's data from the server using a custom tool.
I want to write the timestamp of the latest updates done on user's machine in the cache file.
Where is the best location for keeping this file:
1. in application directory (c:\program files..)
2. in a temp location e.g. Users profile folder or c:\windows\temp
3. in any location (e.g. c:\dataupdates) where user has full access to read/write to.
Not in the application directory. That much is clear. :) The application directory shouldn't even be writable by the program (or actually by the user account that runs the program). Although some applications still use this location, it has actually been deprecated since Windows 95, I believe, and it has become a real pain since the more rigid UAC applied in Windows Vista and 7.
So the most obvious options are:
The temp folder, which is for temporary files. Note however, that you will need to clean those files up. Temp folder is not automatically cleared by default, so adding new files all the time will consume increasingly much space on the hard drive. On the other hand, some users do clear their temp folders, or may have scripts installed that do that for them, so you cannot trust such files to remain. Also, this is not always C:\Temp of whatever. You'll have to ask Windows what the location is.
You can pick 'any' location. Note that you cannot write anywhere. You cannot even expect the C drive to exist. If you choose this, then you have to make it a configurable setting.
The %app data% directory, my personal favorite, which is a special directory for applications to store their data in. The advantage is, that you can ask Windows for this location, and you can make up a relative path based on that directory, so you don't really have to make it an application setting. For more info on how to get it, see also this question: C# getting the path of %AppData%
I would definitely choose the App Data path for this purpose.

What is the appropriate directory of permanent cache files wrote within rubygems (like unix's /var)?

I am developing a rubygem, which bundle a simple CLI.
The CLI will make a web server request and cache part of its response to a text file.
But, in development, I couldn't find appropriate place to store the response cache (I did some google search). I simply placed it in the "var" directory on gem's root. But I don't think gem's root is a good place for cache files.
tmpdir is good for temporary cache files, but I want to store cache permanently.
Are there any better practice on directory path for such cache files?
As you probably do not want users to share cached content (and because of other security concerns), I would put it in /home/$USER/.$GEMNAME/cache (e.g. /home/yukihr/.awesomecli/cache). I do not know nothing about Windows or Mac OS, but I am sure there is a clean, portable way to access the user's home directory and place a hidden folder there.

Move source code files to CodeIgniter folders

I am starting to work on some incomplete stuff in codeigniter. I had to install codeigniter on my machine. I have the source code files from the previous work, however I am confused how to move these files to CodeIgniter folder to access them as usual and start working on them.
I am not sure which files go to which folder in the CodeIgniter Folders available when downloaded.
Download and install Codeigniter on your machine first. Check out in which folders the controllers/models/views/configs reside.
Then you will have an idea which files reside where, if you still have some problems take a peek in the documentation.
CodeIgniter have and system a application folder.
I'd recommend a new download.
I doubt some change was made on system folder, so I think you can ignore it from your project and use the new downloaded one
The project is on the application and there you have some folders, as mentioned by gopi1410, that you need to take care, maybe there are libraries, models, controllers, configurations files, autoload, etc.
And tell us what it the version of you application. If it is a old version, there will be some problem using the new version system folder.

codeigniter installation - location of the system and application folders

fellow codeigniters, I’m moving my local ci site onto a media temple server and I’m having a problem with the location of the system and application folders.
the structure of the server is as follows:
../domains
/mysite.com
/html
html is the root of my domain. i.e this is where i’d go when i access www.mysite.com
I placed the ci system folder (ci_system) under domains.
since the html folder is being used by a few ‘under construction’ files, I created a subfolder called ‘mysiteapp’ under html and placed my application folder, idex.php, css, js folders there.
so it looks like this:
../domains
ci_system
/mysite.com
/html
/mysiteapp
/application
/css
/assets
/js
index.php
I edited the index.php file so that $system_folder = “../../../ci_system”;
the problem is, when I access the site, i get a php error:
Warning: require(../../../ci_system/application/config/constants.php) [function.require]: failed to open stream: No such file or directory in /nfs/c08/h04/mnt/xxxxxx/domains/ci_system/codeigniter/CodeIgniter.php on line 52
so it looks like the ci_system folder is being located however CI is still trying to locate the application folder off of the ci_system folder.
I have tried specifying the full path the the application folder but it still tries to concatenate the 2 together.
I have not done many ci installations and my local one was done months ago and i don’t remember it being a pain. so I’m not sure where to look to fix this problem.
hope someone can help.
thanks
Ok So the index.php file does have the $application_folder var which can be set and pointed towards the application dir. Could you be kind enough to share the index.php file? You may have to set both up .. i.e the system folder path and the application folder path.
And the only problem I noticed with your system path is that its relative when the CI doc states that you have to use full server paths...
It is possible to move your application folder to a different location
on your server than your system folder. To do so open your main
index.php and set a full server path in the $application_folder
variable.
$application_folder = "/Path/to/your/application";
If you do want a quick fix, and have shell access, create a sym link, that should fix it quickly, but its just cutting around the corner.
What is inside your ci_system directory? Do you see directories like core, database, libraries etc.?
According to your warning message, you have codeigniter in /domains/ci_system/codeigniter, or you have wrong settings in your index.php.

Move the whole joomla site to a different directoy/subdomain

I am currently developing a joomla 1.5 based site in a temp subdomain (which points to a subfolder on ther sever where all joomla stuff is installed). Currently I am using plugins joomgallery an kunene 1.0.9 (legacy mode).
Once the development is done I would like to move the whole site into the root directory and delete the whole subdomain. How would this ideally be done? Can I just move the files or is there more to it? Any common pitfalls to watch out for? E.g. Are there absolute paths referenced somehwere?
In your configuration.php file, the base path might be defined, something like this:
var $live_site = 'http://temp.mysite.com/';
...though I think by default now, it automatically detects this value for you.
Check in the configuration of your custom components to see if they have got the paths "hardcoded" in there too.
Another thing you could do is set up a .htaccess file with some RewriteRules so that any call to http://temp.mysite.com gets redirected to http://www.mysite.com
There is a free Joomla! extension for this called Joomlapack. Just make a backup with Joomlapack, move the backup files that was created to the new site/folder and run the script that also was created in the backup. Done!
Joomlapack makes a complete backup on both the DB and site files so you can move your site anywhere if you wanted. Joomlapack can be found here: http://www.joomlapack.net/
Make sure to edit your configuration.php file as per these instructions.

Resources