Laravel custom DB Databable - database

I'm interested in having a Table in my Laravel database, where I can read/write from.
However, I don't want it do be affected by php artisan migrate:fresh or php artisan migrate:refresh commands.
I want to use it as a custom storage for a dataset, which will be imported in the database and updated when needed but only be readable by Laravel.

the only thing that is come to my mind on the first place, is to create a route /create/customdbtable/ and insite the method use schema to create the table with all options, and then I think will not be touch by migration – Plamen Penchev

Related

What files make one Wordpress site different from another

Migrating wordpress sites between hosts can take a lot of time, especially when the hosting platforms are different.
I have been trying to migrate my sites from Cpanel to Mediatemple, but it seems like im just not getting it right.
There is various options
Use the guide they provide
https://kb.mediatemple.net/questions/1556/Migrating+your+websites+to+the+Grid#gs
When moving the files in this way the permissions of the files are not set properly and I would have to got back through them and figure out which ones need to change.
The database export from PHPMyAdmin also does not look the same it looks in the screenshot
Using InfiniteWP
To use InfiniteWP you must provide the url of the site and since I dont want to change the DNS until the site is moved this option does not seems to be ideal.
This option might work if its ok for the sites to be unavailable for a day or so while the DNS resolves...
But I don't want the sites to be unavailable
Using Mediatemples "one click apps" to install wordpress and then moving only the files that are unique to the site from the old host to the new host.
I would like to use this option
I think that the content of the WP-Content folder needs to be moved that the database needs to be moved.
My question is
- what folders and files in a standard wordpress install typically hardly ever changes from one site to the other.
- can I use the wordpress database export and import function to move the database from one site to the other.
Any help will be appreciated
Thank you
With InfiniteWP, you can use the clone an existing site command (which can be found in "Tool"->"Install / Clone WP") to migrate a site to a new server.
You have to use a temporary (sub)domain pointing to the new server.
To answer your questions :
/wp-content/ stores all your files and sometimes plugin files, wp-config.php is where your configuration is stored (e.g. credentials to access the database). Depending on your servers, the .htaccess files may be different.
I would recommend to create a dump file of your entire database using phpMyAdmin.

Liferay document checkin issue

I'm still new to Liferay and using Liferay 6.2
what i'm doing:
I am trying to add a document manually into my database using insert statement.
I inserted into dlfileentry, dlfileversion and AssertEntry.
Also, i created a folder with the valid name and file.
The issue:
upon entering the Documents and Media portlet, i can see the document name there but when i click on checkout, it will prompt a error saying that Documents and Media is temporarily unavailable. however i am still able to download the valid document.
Am i doing something wrong? Personally, i feel that i am missing one more table for the database but i'm not sure .
Thanks!
Yes, you're doing something wrong: You should never write to Liferay's database with SQL, as there might be more data required than what's directly visible to you. Obviously, you're running into exactly such an issue.
Liferay has an API which you can use locally, from within the same application server, or remotely as JSON or SOAP service. You should exclusively use this for write access to the database.
Alternatively, you might consider WebDAV access to your document repository as the way to add more documents to the document library.

load txt data to database in django

I created a database model in django. But I would like to load initial data (in the form of a txt file, each row coresponding to a data) to this model. How can I achieve this?
I know how to load data to the mysql directly but not through django.
Django's documentation provides information for your use case, see [Providing initial data for models][1]
You will have to store your data as JSON/YAML/JSON.
You can dump existing data with python manage.py dumpdata

Uploading a completed WP site without redoing the design/theme part

Am wondering if there is anyway to clone/move the whole WP site I've design as it is?
Would like to avoid the idea of restarting all over again with the slider setting, colours, theme config, menu? Its rather time consuming when it involves Multisite.
The export/import tool only saves the post, tags, image library etc.
Help much appreciated. Really.
I recommend using the WP Migrate DB plugin. If you have access to the MySQL server on your new site / location (command line, phpMyAdmin, SequelPro, etc) you can import your database as a whole.
As a brief overview, this plugin does two things for you. First, it's a MySQL dump (grabbing the entire database including any additional tables that aren't standard WordPress tables).
It'll also replace any URLs that might be serialized in your content from the old site to the new site. (A very important piece if you plan to change your domain name).
Have fun!
Don't use the export/import tool when you're using wordpress.org this tool should in my opinion only be used when transferring from wordpress.com to wordpress.org.
In this case just:
Change the WordPress & Site URL in the settings
Export the whole database
Import the database on the new server
Move all files with FTP to the new server
Use the "Search & Replace" plugin to find and replace all reference to the old URL (when the url changes)

How do I make a CRON job to use the export feature of phpmyadmin to export DB

I want to export some tables in my DB to an Excel/Spreadsheet every month.
In PHPMyAdmin there is a direct option of exporting the result of a query to the desired filetype. How do I make use of this export feature without another script to run a cronjob on a monthly basis?
Basically on a CPanel (the DB is hosted in the web) we just have to give the path to the script to be executed via a cronjob. But in PHPMyAdmin there is no such opportunity. Its an included feature of PHPMyAdmin where we generally click and do it mannually. So how do i do it in Cpanel?
Do you have ssh access to the box? Personally I'd implement this outside of phpmyadmin, as phpmyadmin is just intended for manual operations via the interface. Why not write a simple script to export the db?
Something like mysqldump database table.
Being a web-app, the export function is a POST request. In the demo application the URL is http://demo.phpmyadmin.net/STABLE/export.php, and then the post data contains all the required parameters, for example: (You can use Fiddler/Chrome dev tools too view it)
token:3162d3b849cf652c2577a45f90022df7
export_type:server
export_method:quick
quick_or_custom:custom
output_format:sendit
filename_template:#SERVER#
remember_template:on
charset_of_file:utf-8
compression:none
what:excel
codegen_structure_or_data:data
codegen_format:0
csv_separator:,
csv_enclosed:"
.....
The one tricky bit is the authentication token, but I believe this is also possible to overcome using some configuration and/or extract parameters (like the 'direct login' in http://demo.phpmyadmin.net/)
See here
How to send data using curl from Linux command line?
If you want to avoid all this, there are many other web-automation tools that can record the scenario and play it back.
just write a simple php script to connect to your database and use the answer here:How to output MySQL query results in CSV format?

Resources