I've just installed a local copy of Magento. For some reason, importing the sample data overwrites the admin_users table and totally empties the core_config_data table. Restoring my admin user access is easy but restoring the configuration is impossible for me at the moment (yes, it's my fault. I forgot to backup my database before importing)
Say, anybody here who knows the keys to the configuration file or better if you can share a copy of the Magento configuration table?
Thanks in advanced.
Ouch. This is why the test data instructions tell you to import the sample data first and then do the Magento install.
Given the quantity of data in the core_config_data table, it will be easier to reinstall Magento to recover it as its contents are created by all the install scripts in each module and the contents vary from version to version.
There is the possibility that you can create the skeleton contents for the core_config_data table from here (magereverse.com) by using the appropriate sections out of the structure dump.
Related
I have created a Prestashop website with a database N°1. For some reasons, I want to write a script, that I'll execute a few times and that will simply fill a database N°2 with some data. This script has nothing to do with my Prestashop website, but is part of the same project and then, must be hosted in the same server, and moreover must be present within the Prestashop website's files (under a module directory I've made).
My question is: is it possible to use this database N°2 (only for this script)? Can I use Prestashop's Db.php class to do it?
Don't hesitate to ask for more informations if I'm not clear.
So if i am reading your post correctly you want to create two databases.
For example "prestashop_n1" and "prestashop_n2".
prestashop_n1 contains all prestashop required tables.
prestashop_n2 contains data extracted from prestashop_n1
In order to extracted data from prestashop_n1 to prestashop_n2 you could write a module.
In this module you can create a database connection to database prestashop_n2
You can use PHP to copy data from prestashop_n1 to prestashop_n2
Alternative you can add a cron-job to execute your script for copying data x times a day.
I am working in a system which gets reloaded frequently. When the system is reloaded a lot of files can be deleted or changed back to a previous stable build version (it's a dev environment). The only thing that doesn't get reloaded is a database.
I have been tasked with inserting and deleting .sql scripts into the environments so that if required someone can run them at a given time. Usually 2 weeks after the files have been added to the system.
Initially I had thought of creating a directory to keep the files, and make a table where one of the columns keeps the path to these .sql files. This would allow for someone to query the database and using the path they could execute a desired script. The problem is the environment constantly reloading which could result in losing files.
Am I correct in assuming that the correct way to approach this is to use BLOB datatype to store the .sql files? The database isn't reloaded so no files would be lost. I am new to SQL and I'm unsure what is the correct approach to this. Would Varchar also work? Is one datatype more efficient than the other?
I wouldn't put SQL scripts in a SQL database, it doesn't feel right.
Sql Scripts usually go in a git repo, in order to be versioned and have better visibility.
Hello guys i am working on odooV10 community version. I have installed my own module for HR payroll and leave management with a DB consisting of records. My question is MY created module wants to install on another machine. How can i achieve that.??? is that database entries stored in the same module folder???
I hope someone can clear my doubt..
for more clarity:
I will install payroll in my system
edit all entries as i want
copying this payroll module in another machine
These are the steps that i planning to do.
Are you wanting to have a set of default records that always install with your module?
If so, you want to load these into a data file that will make these a permanent part of your module.
You can read about data files in the documentation and/or review how Odoo does this in the core code.
If you're only needing to get the records into another database, you can Export from the first database and Import into the next.
You have several options, you must choose the one that best fits your situation:
If you want to pass information from one database to another you can use the export option of odoo:
1) Go to the tree view of the model you want to export and select the record (s).
2) Expand the More option and click on Export.
3) Select the fields you want to export and save the csv file that will be used to import.
To import: you must go to the tree view and select the Import button that should appear next to the Create option and follow the steps indicated.
If you want to keep the data in your modules to be created every time you install you must create data.xml files
You can export the database directly. You can visit this page to know the steps to do it from odoo
Create-backup
I hope I've helped
I have set up a wordpress site, installed a theme, imported the sample data xml file, and did a sqldump of the database after completing these steps. I have a script that will automate the creation of the wordpress directory and database for a new site. I would like to add restoring the new database with the dump file. I have been able to do this but the links to wp-admin and wp-login point to the old site's directory instead of the new one. Any idea of why this may be and what can be done to avoid this?
I found the problem. The sql dump simply had all the data including the absolute links that were generated. So I used perl to search for the strings I needed to update in the sql dump before I put the data into the new database. Thanks.
I have created an application in VB.NET (using Microsoft Visual Basic 2010 Express) with a local database (SQL Server Compact 3.5 database) to store data.
I have installed this on the users computer, and added a "search online for updates" functionallity (which can be selected when publishing)
Now i have noticed, that sometimes when i upload a new version, the data from the database gets cleared. (possibly when i opened the dtb while developing)
This is offcourse not how i want the system to behave, and the data should always remain on the users computer.
In 'Application Files' the database file (*.sdf) is currently set to 'Data File (Auto)', but i'm unsure of the exact way this works.
Could anyone help me to understand how all of this works, and tell me how i can be sure that the data in the users database will remain, even after an update?
If there is no solution to ensure this, is there a way to safely backup the data and reload it?
Thanks in advance!!
Basically, the click one install overwrites everything in the program folder that is included in your publish. So if you include the .sdf then it will overwrite it when the installer is executed. What you need to do is select "exclude" on the sdf instead. This will keep the database in its previous state.
So my recommendation would be to have 2 different publishes. One that you create that contains the .sdf which is only used on first time installation, and then in all the update ones you exclude it.
To perform updates on your tables you would have to write the SQL for it in your software. Basically do a check on all tables to see that they have the proper setup on startup. If they don't then you add the missing columns.
Hope this helps.