RO CSVI
MySQL server has gone away
| RO CSVI
The error MySQL server has gone away is a bad configuration setting on the server. The first work-around that can be tried is the following:
- Open the file administrator/components/com_csvi/csvi.php
- Find line 12 where the following code is:
defined('_JEXEC') or die;
// Access check.
- Change this to read:
defined('_JEXEC') or die;
ini_set('mysql.connect_timeout', 300);
ini_set('default_socket_timeout', 300);
// Access check. - Save the file
A second work-around to try is the following (this is a Joomla core hack !):
- Open the file administrator/index.php
- Find line 14 where the following code is:
// Set flag that this is a parent file
define( '_JEXEC', 1 );define('JPATH_BASE', dirname(__FILE__) );
- Change this to read:
// Set flag that this is a parent file
define( '_JEXEC', 1 );ini_set('mysql.connect_timeout', 300);
ini_set('default_socket_timeout', 300);define('JPATH_BASE', dirname(__FILE__) );
- Save the file
The use and non-use of ID fields
| RO CSVI
The use of ID fields in import files often gives many users problems, whether this is due to not reading the documentation or expecting different behaviour from CSV Improved is not the question I want to answer here. What I do want to hightlight is the problems that might occur using ID fields.
What is an ID field?
An ID field is a field that holds a unique reference number for data in the database. Examples of ID fields are:
- product_id: Holds the ID for a product
- manufacturer_id: Holds the ID for a manufacturer
- category_id: Holds the ID for a category
- etc.
What is the life expectancy of an ID field?
The life expectancy of an ID field can range from days to years. As long as the data does not get deleted from the database the ID stays the same. Regularly deleting and importing new data makes the ID change as often as this process is repeated.
How important is the ID field?
As mentioned earlier, the ID field is unique. This makes it important however not as important as other fields that are more consistent than the ID field. Some examples of more important fields:
- product_sku: The Stock Keeping Unit will almost never change as it identifies a specific product
- manufacturer_name: The name of a manufacturer is also unlikely to change
- category_path: The name of a category is unlikely to change
Even though the ID field is important to the shop, other fields are more important for import.
Which field should I use?
It is advised not to use ID fields for import. CSV Improved will find the correct ID based on the other fields you import. If an ID is ever changed and you don't know about it, the import will go wrong.
Another example is when you are importing new data, the ID field does not exist and nothing will be imported as the database cannot find the ID and your shop will remain empty.
Final words
Be cautious using ID fields in your import file, imports are more likely to succeed not using these fields.
Customizing the export filename
| RO CSVI
Requirement: CSVI VirtueMart 2.3.18 or higher
To customize the filename CSVI VirtueMart creates on export you can specify the following tags to have them replaced on export:
| Tag | Meaning | Example |
| [Y] | A full numeric representation of a year, 4 digits | 1999 or 2003 |
| [y] | A two digit representation of a year | 99 or 03 |
| [M] | A short textual representation of a month, three letters | Jan through Dec |
| [m] | Numeric representation of a month, with leading zeros | 01 through 12 |
| [F] | A full textual representation of a month, such as January or March | January through December |
| [n] | Numeric representation of a month, without leading zeros | 1 through 12 |
| [d] | Day of the month, 2 digits with leading zeros | 01 to 31 |
| [D] | A textual representation of a day, three letters | Mon through Sun |
| [j] | Day of the month without leading zeros | 1 to 31 |
| [l] | A full textual representation of the day of the week | Sunday through Saturday |
| [g] | 12-hour format of an hour without leading zeros | 1 through 12 |
| [G] | 24-hour format of an hour without leading zeros | 0 through 23 |
| [h] | 12-hour format of an hour with leading zeros | 01 through 12 |
| [H] | 24-hour format of an hour with leading zeros | 00 through 23 |
| [i] | Minutes with leading zeros | 00 to 59 |
| [s] | Seconds with leading zeros | 00 to 59 |
Source: http://www.php.net/manual/en/function.date.php
Specifying a filename like:
product_export_[Y]_[m]_[d].csv will create a file called product_export_2010_11_06.csv.
Does CSVI upload pictures?
| RO CSVI
No, CSVI does not upload the pictures from your computer to the server. You will have to upload the pictures.
One exception is if you import a file where the full image is a URL and you have chosen in your template to save the images on the server.
How to read a UTF-8 CSV file in Excel 2007?
| RO CSVI
To read a UTF-8 CSV file into Excel 2007, follow these steps:
- Download the exported CSV/XLS file from your website.
- Open Excel 2007
- Open a new file
- Click the Data Menu option
- Click "From Text" button
- Select the file you downloaded
- Make sure "Delimited" is selected and Press Next
- Select 65001: Unicode UTF8 and press Next
- Check the delimiter characters that you know are in your file like Comma or Tab or whatever is in your case. You can select more than one
- Proceed to Next Step and Finish
- Your excel file will be ready with all you data displayed correctly